finish extra/skipping-work #25

Merged
seongbeom_park merged 2 commits from extra/skipping-work into main 2022-05-10 13:32:17 +00:00
2 changed files with 17 additions and 0 deletions
Showing only changes of commit cef43f23e0 - Show all commits

View File

@ -105,3 +105,6 @@ CFcSBwgCCBoHRhkKU1cGAA4AGU5YQR5THBwNFwoGGAxTQQMQVBUSBg4EAAwQRhUQVBUHFAQTGRpT QQM
### numbers-station-coded-messages
* Completed in: 10 mins, 1 secs.
### skipping-work
* Completed in: 20 mins, 58 secs.

View 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)