Amazon Interview Question

Find the sum of a subarray and then whats the max element within a subarray