Sliding Window Introduction Identification And Types - Intro 2
Easy

Problem Statement

Given an array of integers Arr and a number k, return the maximum sum of a subarray of size k using a brute force approach.

Examples

1Example 1
Input:
{ "arr": [ 2, 5, 1, 8, 2, 9, 1 ], "k": 3 }
Output:
19
2Example 2
Input:
{ "arr": [ 100, 200, 300, 400 ], "k": 2 }
Output:
700
3Example 3
Input:
{ "arr": [ 1, 4, 2, 10, 23, 3, 1, 0, 20 ], "k": 4 }
Output:
39
Loading...

Sign in to Run Code and Submit