Tap here to switch tabs
Problem
Submissions

Problem: Longest Subsequence With Non-Zero Bitwise XOR

med
30 min
Try to solve the Longest Subsequence With Non-Zero Bitwise XOR problem.

Statement

Given an integer array nums, return the maximum length of a subsequence of nums whose bitwise XOR sum is not equal to 00. If no such subsequence exists, return 00.

Note: A subsequence is a sequence that can be derived from an array by deleting zero or more elements without changing the order of the remaining elements.

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 Subsequence With Non-Zero Bitwise XOR

med
30 min
Try to solve the Longest Subsequence With Non-Zero Bitwise XOR problem.

Statement

Given an integer array nums, return the maximum length of a subsequence of nums whose bitwise XOR sum is not equal to 00. If no such subsequence exists, return 00.

Note: A subsequence is a sequence that can be derived from an array by deleting zero or more elements without changing the order of the remaining elements.

Constraints:

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

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