You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Do this inO(n)time andO(k)space. You can modify the input array in-place and you do not need to store the results. You can simply print them out as you compute them.
The text was updated successfully, but these errors were encountered:
Given an array of integers and a number
k
, where1 <= k <= length of the array
, compute the maximum values of each subarray of lengthk
.For example, given
array = [10, 5, 2, 7, 8, 7]
andk = 3
, we should get:[10, 7, 8, 8]
, since:Do this in
O(n)
time andO(k)
space. You can modify the input array in-place and you do not need to store the results. You can simply print them out as you compute them.The text was updated successfully, but these errors were encountered: