diff --git a/README.md b/README.md index 543eb5d..fe116a7 100644 --- a/README.md +++ b/README.md @@ -105,3 +105,6 @@ CFcSBwgCCBoHRhkKU1cGAA4AGU5YQR5THBwNFwoGGAxTQQMQVBUSBg4EAAwQRhUQVBUHFAQTGRpT QQM ### numbers-station-coded-messages * Completed in: 10 mins, 1 secs. + +### skipping-work +* Completed in: 20 mins, 58 secs. diff --git a/extra/skipping-work/solution.py b/extra/skipping-work/solution.py new file mode 100644 index 0000000..6979374 --- /dev/null +++ b/extra/skipping-work/solution.py @@ -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)