My 3ms JAVA solution...looks like not well


  • 0
    S
    		 if(nums==null||nums.length==0)
    			 return 0;
             if(nums.length==1)
    			 return nums[0];
    		 int result=nums[0];
    		 int sublen=nums.length/2;
    		 Arrays.sort(nums);
    		 result=nums[sublen];
    		 return result;
    	 }
    

Log in to reply
 

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