java 7ms solution


  • 0
    E
    public class Solution {
        public char findTheDifference(String s, String t) {
            String st = s + t;
            char[] a = st.toCharArray();
            int b = 0;
            for (int i : a)
                b ^= i;
            return (char)b;
        }
    }

Log in to reply
 

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