Skip to content

Commit

Permalink
Create 220209_12912.py
Browse files Browse the repository at this point in the history
  • Loading branch information
lynn06091 committed Feb 9, 2022
1 parent bf87678 commit 6b16562
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions YYR/programmers/220209_12912.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
def solution(a, b):
answer = 0


if a == b:
answer = a
elif a > b:
answer = (a+b)*(a-b+1)/2
elif a < b:
answer = (a+b)*(b-a+1)/2

return answer

0 comments on commit 6b16562

Please sign in to comment.