Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions algorithms/warmup/mini_max_sum/Keren_solution
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/python3

import math
import os
import random
import re
import sys

# Complete the miniMaxSum function below.
def miniMaxSum(arr):
total = sum(arr) # sum up all the integers in the array
sums = [total - arr[i] for i in range(len(arr))] # get the sum of only 4 of the integers

print(min(sums), max(sums))



if __name__ == '__main__':
arr = list(map(int, input().rstrip().split()))

miniMaxSum(arr)