Given an array of n integers, find the sub-array of length k with maximum sum. For example, Input Array: {6, 4, 3, 5, 1, 9, 2} k:3 Output: 15 (sum of sub-array 5, 1, 9) Solution: The brute-force solution for this problem is to find sum of all the sub-arrays of length k, and return […]
Published on February 11, 2018 02:44