Java easy solution


  • 1
    H

    public class Solution {
    public char findTheDifference(String s, String t) {
    String str = s + t;
    char letter=str.charAt(0);
    for (int j = 1; j < str.length(); j++) {
    letter^=str.charAt(j);
    }
    return letter;
    }
    }


Log in to reply
 

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