Easy C++ solution


  • 0
    B

    '''class Solution {
    public:
    char findTheDifference(string s, string t) {

     int m=s.length();
     int n=t.length();
     char result=s[0];
     for(int i=1;i<n;i++){
         result=result^s[i];
     }
     for(int j=0;j<n;j++){
         result=result^t[j];
     }
     return result;
        
    }
    

    };'''


Log in to reply
 

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