Find the Difference LeetCode solution in Python

1
class Solution:
2
def findTheDifference(self, s: str, t: str) -> str:
3
c = 0
4
for cs in s:
5
c ^= ord(cs) # ord is ASCII value
6
for ct in t:
7
c ^= ord(ct)
8
return chr(c) # chr = convert ASCII into character

0

WPM •0 •0

100%

ACC •0 •0

0s

TIME •0