#3681

Maximum XOR of Subsequences

candidate master · 1405 · lc hard +32 · 51.3% accepted · 59 likes · top 40%

Description

An array nums of non-negative integers is given. Pick two (possibly empty, possibly overlapping) subsequences, compute X = XOR of the first and Y = XOR of the second. Return the maximum value of X XOR Y. An empty subsequence has XOR value 0.

Code

1
2
3