NeetCode #870LC-3097MediumBit Manipulation
← Back to All Problems#870 · #3097 · Shortest Subarray With OR at Least K II(或值至少为 K 的最短子数组 II)
📌 Problem Statement & Constraints
Given an array
nums of non-negative integers and an integer k, return the length of the shortest non-empty subarray whose bitwise OR is at least k, or -1 if no such subarray exists. Constraints: 1 <= nums.length <= 2 * 10^5, 0 <= nums[i] <= 10^9, 0 <= k <= 10^9.🔒
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!