Tap here to switch tabs
Problem
Submissions

Problem: Shortest Subarray With OR at Least K I

med
30 min
Try to solve the Shortest Subarray With OR at Least K I problem.

Statement

You are given an array of non negative integers nums and an integer k.

An array is considered special if the bitwise OR of all its elements evaluates to at least k.

Return the length of the shortest non empty special subarray of nums, or −1-1 if no such subarray exists.

Constraints:

  • 1≤1 \leq nums.length ≤50\leq 50

  • 0≤0 \leq nums[i] ≤50\leq 50

  • 0≤0 \leq k <64< 64

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Shortest Subarray With OR at Least K I

med
30 min
Try to solve the Shortest Subarray With OR at Least K I problem.

Statement

You are given an array of non negative integers nums and an integer k.

An array is considered special if the bitwise OR of all its elements evaluates to at least k.

Return the length of the shortest non empty special subarray of nums, or −1-1 if no such subarray exists.

Constraints:

  • 1≤1 \leq nums.length ≤50\leq 50

  • 0≤0 \leq nums[i] ≤50\leq 50

  • 0≤0 \leq k <64< 64