Tap here to switch tabs
Problem
Submissions

Problem: Longest Strictly Increasing Subsequence, Non-Zero AND

Longest Strictly Increasing Subsequence, Non-Zero AND asks for the longest subsequence in an integer array with strictly increasing values and a positive bitwise AND. Return its length, or zero.

Statement

Given an integer array nums, return the length of the longest strictly increasing subsequence of nums such that the bitwise AND of all elements in the subsequence is strictly greater than 00.

If no such subsequence exists, return 00.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i] ≤109\leq 10^9

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Longest Strictly Increasing Subsequence, Non-Zero AND

Longest Strictly Increasing Subsequence, Non-Zero AND asks for the longest subsequence in an integer array with strictly increasing values and a positive bitwise AND. Return its length, or zero.

Statement

Given an integer array nums, return the length of the longest strictly increasing subsequence of nums such that the bitwise AND of all elements in the subsequence is strictly greater than 00.

If no such subsequence exists, return 00.

Constraints:

  • 1≤1 \leq nums.length ≤105\leq 10^5

  • 0≤0 \leq nums[i] ≤109\leq 10^9