1863. Sum of All Subsets XOR Total
Practice Sum of All Subsets XOR Total for free on NudgeCode: Easy, Backtracking pattern. Write it in Python or JavaScript, run the tests in your browser, and ask for a hint when you are stuck.
The XOR total of an array is the bitwise XOR of all its elements (0 for an empty array). Return the sum of the XOR totals of every subset of nums. Subsets with the same values but different positions count separately.
Example
nums = [1,3] -> 6 ([] 0, [1] 1, [3] 3, [1,3] 2)
Constraints
- 1 <= nums.length <= 12
- 1 <= nums[i] <= 20