Maximum Sum of Subarray with Length Constraint
Algorithms: Searching, Sorting & Big-O
Given a list of numbers `arr`, return the sum of all elements.
// EXAMPLES
Example 1:
Input:
Input: [1, 2, 3, 4]Output:
10Explanation: Result for example 1 of Maximum Sum of Subarray with Length Constraint.
Example 2:
Input:
Input: [-1, 1, 0]Output:
0Explanation: Result for example 2 of Maximum Sum of Subarray with Length Constraint.
// CONSTRAINTS
1 <= len(input) <= 10^5Time Complexity target: O(N) or O(N log N)Space Complexity target: O(1) or O(N)Evaluated against 600 test cases.
solution.py