#3095

Shortest Subarray With OR at Least K I

pupil · 485 · lc easy +27 · 44.2% accepted · 139 likes · top 26%

Description

Given a non-negative integer array nums and an integer k, an array is special if the bitwise OR of all its elements is at least k. Find and return the length of the shortest non-empty special subarray, or -1 if none exists.

Code

1
2
3