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.
- Prepare
- Algorithms
- Warmup
- Mini-Max Sum
- Discussions
Mini-Max Sum
Mini-Max Sum
Sort by
recency
|
5957 Discussions
|
Please Login in order to post a comment
Solution in Swift with method Sorted()
def miniMaxSum(arr): # Write your code here min = 0 max = 0 length = len(arr) arr.sort() for i in range(1, len(arr)): min = min + arr[length - 2] max = max + arr[length - 1] length -= 1 print(min, max)
long maxval =0; long minval =0; Collections.sort(arr);
using System.CodeDom.Compiler; using System.Collections.Generic; using System.Collections; using System.ComponentModel; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.Serialization; using System.Text.RegularExpressions; using System.Text; using System;
class Result {
}
class Solution { public static void Main(string[] args) {
}