← All problemsSign in

3825. Longest Strictly Increasing Subsequence With Non-Zero Bitwise AND

LeetCodeArrayBinary SearchBit ManipulationEnumerationOpen on judge ↗

You are given an integer array nums. Return the length of the longest strictly increasing subsequence in nums whose bitwise AND is non-zero. If no such subsequence exists, return 0. Example 1: Input: nums = [5,4,7] Output: 2 Explanation: One longest strictly increasing subsequence is [5, 7]. The bitwise AND is 5 AND 7 = 5, which is non-zero. Example 2: Input: nums = [2,3,6] Output: 3 E

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start