From d4b301f5852b2b2144256f0d4f62547bd92cb699 Mon Sep 17 00:00:00 2001 From: Seongbeom Park Date: Sun, 8 May 2022 03:53:42 +0900 Subject: [PATCH] finish extra/bunny-worker-locations Submitting solution... Submission: SUCCESSFUL. Completed in: 6 mins, 49 secs. --- README.md | 3 +++ extra/bunny-worker-locations/solution.py | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 extra/bunny-worker-locations/solution.py 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)