C simple solution 0ms


  • 0
    char findTheDifference(char* s, char* t) {
        char result = 0;
        int len = strlen(s)+1;
        for(int i=0; i<len; i++){
            result = result ^ s[i];
            result = result ^ t[i];
        }
        return result;
    }
    

Log in to reply
 

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