Tip 1 : practice competitive programming regularly
Tip 2 : look at interview experience
Tip 3 : talk to seniors who work there
Tip 1 : get it reviewed by professional
Tip 2 : mention only what you know



Input: ‘arr’ = [1, 1, 2] and ‘k’ = 2
Output: 2
Explanation: If we want to make two subarrays, there are two possibilities: [[1], [1, 2]] and [[1, 1], [2]]. We can see that the maximum sum of any subarray is minimized in the second case. Hence, the answer is 2, which is the maximum sum of any subarray in [[1, 1], [2]].
The first group consists of the first K elements of the array, the second group consists of the next K element of the Array, and so on. Each element can be a part of exactly one group.
For the last group, if the array does not have K elements remaining, use 0 to complete the group.




Here's your problem of the day
Solving this problem will increase your chance to get selected in this company
How do you remove whitespace from the start of a string?