Submitting solution... Submission: SUCCESSFUL. Completed in: 6 mins, 49 secs.
14 lines
272 B
Python
14 lines
272 B
Python
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)
|