aloo_lelo

bruteCoder avatar
bruteCoder
java
12/18/2023 2:46 PM
328 B
22
Indexable

class Solution {
    static int gameOfXor(int N , int[] A) {
        // code here
        
        if(N%2 == 0 )return 0;
        
        int out = 0 ;
        
        for(int i = 0 ;i<N;i+=2) out ^= A[i];
        
        return out;
    }
};
Editor is loading...
Leave a Comment