finish extra/skipping-work #25
@ -105,3 +105,6 @@ CFcSBwgCCBoHRhkKU1cGAA4AGU5YQR5THBwNFwoGGAxTQQMQVBUSBg4EAAwQRhUQVBUHFAQTGRpT QQM
|
|||||||
|
|
||||||
### numbers-station-coded-messages
|
### numbers-station-coded-messages
|
||||||
* Completed in: 10 mins, 1 secs.
|
* Completed in: 10 mins, 1 secs.
|
||||||
|
|
||||||
|
### skipping-work
|
||||||
|
* Completed in: 20 mins, 58 secs.
|
||||||
|
|||||||
14
extra/skipping-work/solution.py
Normal file
14
extra/skipping-work/solution.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
def solution(x, y):
|
||||||
|
p, q = (sorted(x), sorted(y)) if len(x) > len(y) else (sorted(y), sorted(x))
|
||||||
|
for i, v in enumerate(p):
|
||||||
|
if v != q[i]:
|
||||||
|
return v
|
||||||
|
|
||||||
|
tests = [
|
||||||
|
([[13, 5, 6, 2, 5], [5, 2, 5, 13]], 6),
|
||||||
|
([[14, 27, 1, 4, 2, 50, 3, 1], [2, 4, -4, 3, 1, 1, 14, 27, 50]], -4),
|
||||||
|
]
|
||||||
|
|
||||||
|
for i, o in tests:
|
||||||
|
result = solution(*i)
|
||||||
|
print (i, result == o, result, o)
|
||||||
Loading…
x
Reference in New Issue
Block a user