300x250 arrayMaxConsecutiveSum1 Codesignal - arrayMaxConsecutiveSum Given array of integers, find the maximal possible sum of some of its k consecutive elements. Example For inputArray = [2, 3, 5, 1, 6] and k = 2, the output should be arrayMaxConsecutiveSum(inputArray, k) = 8. All possible sums of 2 consecutive elements are: 2 + 3 = 5; 3 + 5 = 8; 5 + 1 = 6; 1 + 6 = 7. Thus, the answer is 8. Input/Output [execution time limit] 20 seconds (swift) [input] array.int.. 2021. 4. 29. 이전 1 다음 300x250