#3255
Find the Power of K-Size Subarrays II
expert · 1110 · lc medium +32 · 31.4% accepted · 161 likes · top 9%
Description
You are given integer array nums of length n and positive integer k. The power of an array is its maximum if all elements are consecutive ascending integers, otherwise -1.
Return the power of every size-k subarray as an array of size n - k + 1.
Code
1
2
3