Back to the 100
Problem 059Sliding Window
Medium

Longest Nice Subarray

059

Return the length of the longest subarray where every pair of values has bitwise AND equal to zero.

EXAMPLES

Example 1
Input
{
  "nums": [
    1,
    3,
    8,
    48,
    10
  ]
}

Output
3

FUNCTION SHAPE

nums: intArrayint
00:00
3 local tests readyRun with ⌘/Ctrl + Enter. Your code stays in this browser.

Runs solve(...) locally in a browser worker. SWE Playbook does not submit your code. Only run code you trust; Python code may access the network.