Java bit operation xor ^= theta(n) complexity


  • 4
    X
    public int singleNumberEnhanced(int[] nums) {
        int result = 0;
        for (int num : nums) {
            result ^= num;
        }
        return result;
    }

Log in to reply
 

Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.