My two java solution


  • 0
    N

    solution 1 easy

     public static int singleNumber(int[] nums) {
    	   int rs=0; 
            for(int i=0;i<nums.length;i++)
            {
            	rs=rs^nums[i];
            }
            return rs;
     }

Log in to reply
 

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