Skip to content

Commit

Permalink
the-vampiire#1 solution
Browse files Browse the repository at this point in the history
  • Loading branch information
dsargento committed Oct 12, 2018
1 parent 42df591 commit bb5cfcc
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions beginner/sum-of-all-numbers_dsargento.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
def sum_all(num_list):
num_list = sorted(num_list)
diff = num_list[1] - num_list[0]
count = 0
while diff > num_list[0] and diff > 0:
count += diff
diff -= 1
return num_list[0] + num_list[1] + count


print(sum_all([1, 4]))

0 comments on commit bb5cfcc

Please sign in to comment.