NeetCode #877LC-2401MediumBit Manipulation
← Back to All Problems

#877 · #2401 · Longest Nice Subarray(最长优雅子数组)

📌 Problem Statement & Constraints

A subarray is called nice if the bitwise AND of every pair of elements at different positions in it is 0. Return the length of the longest nice subarray. Constraints: 1 <= nums.length <= 10^5, 1 <= nums[i] <= 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!