L604 Window Sum
Given an array of n integer, and a moving window(size k), move the window at each iteration from the start of the array, find thesum
of the element inside the window at each moving.
Example
For array[1,2,7,8,5]
, moving window size k =3
.
1 + 2 + 7 = 10
2 + 7 + 8 = 17
7 + 8 + 5 = 20
return[10,17,20]
感觉挺像209的。
Previous395 Longest Substring with At Least K Repeating CharactersNext1658 Minimum Operations to Reduce X to Zero
Last updated