finish extra/bunny-worker-locations #20
@ -88,3 +88,6 @@ CFcSBwgCCBoHRhkKU1cGAA4AGU5YQR5THBwNFwoGGAxTQQMQVBUSBg4EAAwQRhUQVBUHFAQTGRpT QQM
|
||||
|
||||
### power-hungry
|
||||
* Completed in: 16 mins, 49 secs.
|
||||
|
||||
### bunny-worker-locations
|
||||
* Completed in: 6 mins, 49 secs.
|
||||
|
||||
13
extra/bunny-worker-locations/solution.py
Normal file
13
extra/bunny-worker-locations/solution.py
Normal 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)
|
||||
Loading…
x
Reference in New Issue
Block a user