Bitwise XOR Subsequences

Asked at Goldman Sachs · Coding & Leetcode-style Questions · Difficulty: Medium

A subsequence of an array is formed by removing zero or more elements from an array without changing the order of the remaining elements. In a valid subsequence, each pair of adjacent elements of the subsequence has bitwise XOR equal to `k`. Note that any subsequence of length `1` is valid regardless of the value of `k`, because there is no pair of adjacent elements in such a subsequence.

Loading the problem…