finish extra/bunny-worker-locations

Submitting solution...
Submission: SUCCESSFUL. Completed in: 6 mins, 49 secs.
This commit is contained in:
Seongbeom Park 2022-05-08 03:53:42 +09:00
parent 6ae0b17f93
commit d4b301f585
2 changed files with 16 additions and 0 deletions

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)