From 661fd8b3b6dabdc0cdc61c97ae4db659f7f9f100 Mon Sep 17 00:00:00 2001 From: Mungai Keren <51922244+MungaiKeren@users.noreply.github.com> Date: Wed, 18 Nov 2020 22:25:51 +0300 Subject: [PATCH] Create Keren_solution --- algorithms/warmup/mini_max_sum/Keren_solution | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 algorithms/warmup/mini_max_sum/Keren_solution diff --git a/algorithms/warmup/mini_max_sum/Keren_solution b/algorithms/warmup/mini_max_sum/Keren_solution new file mode 100644 index 0000000..82ddda4 --- /dev/null +++ b/algorithms/warmup/mini_max_sum/Keren_solution @@ -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)