find the difference or the extra character

PHOTO EMBED

Fri Apr 05 2024 09:24:28 GMT+0000 (Coordinated Universal Time)

Saved by @hiimsa #java

public char findTheDifference(String s, String t) {
        char ch =0;
        for(int i=0; i<s.length(); i++) {
            ch ^= s.charAt(i);
        }
        for(int i=0; i<t.length(); i++) {
            ch ^= t.charAt(i);
        }
        return ch;
    }
content_copyCOPY