diff --git a/README.md b/README.md index 2efbb04..39dce6e 100644 --- a/README.md +++ b/README.md @@ -88,3 +88,6 @@ CFcSBwgCCBoHRhkKU1cGAA4AGU5YQR5THBwNFwoGGAxTQQMQVBUSBg4EAAwQRhUQVBUHFAQTGRpT QQM ### power-hungry * Completed in: 16 mins, 49 secs. + +### bunny-worker-locations +* Completed in: 6 mins, 49 secs. diff --git a/extra/bunny-worker-locations/solution.py b/extra/bunny-worker-locations/solution.py new file mode 100644 index 0000000..afab071 --- /dev/null +++ b/extra/bunny-worker-locations/solution.py @@ -0,0 +1,13 @@ +def solution(x, y): + return str(((x + y - 1) * (x + y) / 2) - (y - 1)) + +tests = [ + ([1, 1], "1"), + ([3, 2], "9"), + ([5, 10], "96"), + ([2, 3], "8") + ] + +for i, o in tests: + result = solution(*i) + print (i, result == o, result, o)