Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Solution {
- public char findTheDifference(String s, String t) {
- int res = 0;
- for(int i = 0; i < s.length(); i++){
- res ^= (int) s.charAt(i);
- res ^= (int) t.charAt(i);
- }
- res ^= (int) t.charAt(s.length());
- return (char) res;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement