Elegant Java solution


  • 0
    P

    public class Solution {
    public char findTheDifference(String s, String t) {
    s=s+t;
    int tk = ' ';
    for(int i =0;i<s.length();i++)
    tk = tk^s.charAt(i);
    return Character.toLowerCase(((char)tk));
    }
    }


Log in to reply
 

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