We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Mini-Max Sum
- Discussions
Mini-Max Sum
Mini-Max Sum
Sort by
recency
|
384 Discussions
|
Please Login in order to post a comment
!/bin/python3
import math import os import random import re import sys
#
Complete the 'miniMaxSum' function below.
#
The function accepts INTEGER_ARRAY arr as parameter.
#
def miniMaxSum(arr): # Write your code here total_sum=sum(arr) min_sum=total_sum-max(arr) max_sum=total_sum-min(arr) print(min_sum,max_sum)
if name == 'main':
c++20
function miniMaxSum(arr: number[]): void { let totalSum = 0; let minValue = Infinity; let maxValue = -Infinity;
}