Leetcode 1486: XOR Operation in an Array
In this Leetcode problem, we compute
start XOR start + 2 XOR ... XOR start + 2n
This is the problem statement:
Solution
To resolve the problem, simply compute the result with brute force, here is the full code:
class Solution {
public int xorOperation(int n, int start) {
int…