NeetCode #247LC-3254MediumSliding Window
← Back to All Problems#247 · #3254 · Find the Power of K-Size Subarrays I(长度为 K 的子数组的能量值 I)
📌 Problem Statement & Constraints
You are given an array
nums of n integers and an integer k. For each subarray of size k, it is powerful if its elements can be rearranged into k consecutive increasing integers. Return an array where the i-th element is the last element of the i-th subarray if it is powerful, otherwise -1. Constraints: 1 <= n == nums.length <= 500, 1 <= nums[i] <= 10^5, 1 <= k <= n.🔒
Sign In to Unlock Full Solutions for All 973 Problems
Sign in to access step-by-step logic, benchmark Python3 code, complexity breakdown, and offline export!