MINI MAX SUM

Subscribers:
4,890
Published on ● Video Link: https://www.youtube.com/watch?v=pQVXkC2i57Y



Duration: 4:09
15 views
1


Given five positive integers, find the minimum and maximum values that can be calculated by summing exactly four of the five integers. Then print the respective minimum and maximum values as a single line of two space-separated long integers.

EXPLANATION CODE:
1) The function starts by initializing a variable called sum to 0. It then loops through each element of the input list arr and adds it to the sum variable.

2) To calculate the minimum and maximum values that can be obtained by summing four of the five integers in the input list arr, the function subtracts the maximum value in the list from the sum of all values in the list to obtain the minimum value and subtracts the minimum value in the list from the sum to obtain the maximum value. These values are printed using the print() function. The minimum and maximum values represent the smallest and largest possible sums of four integers selected from the list.

#hackerrank #prepare #algorithms #warmup #minimax #mini #max #sum #python #pythonprogramming #education #coding #programming #easy #difficulty #reading #arithmetic #learntocode #tutorial #problemsolving #algorithmic #asmr #asmrtyping #warmup

Contents:
0:00 - Reading
2:08 - Solving
3:07 - Explaining







Tags:
coding
programming
problem solving
problem
solving
algorithmic
reading
asmr
asmr typing
education
easy difficulty
easy
difficulty
tutorial
how to program
explanation
how to
hackerrank
hackerrank problem solving
python
python programming
mini max sum
mini
max
sum