Java 4 lines Solution


  • 0
    P
     public char findTheDifference(String s, String t) {
                char c=0;
    	        for(char c1:s.toCharArray())	c^=c1;
    	        for(char c2:t.toCharArray())	c^=c2;
    	        return c;
        }
    

Log in to reply
 

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