Given an array of integers 0-9 inclusive, compute the max sum of k elements in the array. Where the length of the
array > 0
andk is 0 < k <= length array
Example: arrayar
isar = [3, 2, 4, 5, 1, 0, 9, 8, 8, 7]
, andk is k = 3
. Should return25
. finish this function (this is python, but you can use any language):
def compute_max_k(ar, k):
return
Is a way to get the biggest item without using a sort