finish extra/bunny-worker-locations #20

Merged
seongbeom_park merged 2 commits from extra/bunny-worker-locations into main 2022-05-07 18:54:52 +00:00
2 changed files with 16 additions and 0 deletions
Showing only changes of commit d4b301f585 - Show all commits

View File

@ -88,3 +88,6 @@ CFcSBwgCCBoHRhkKU1cGAA4AGU5YQR5THBwNFwoGGAxTQQMQVBUSBg4EAAwQRhUQVBUHFAQTGRpT QQM
### power-hungry
* Completed in: 16 mins, 49 secs.
### bunny-worker-locations
* Completed in: 6 mins, 49 secs.

View File

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