[LeetCode] 2351. First Letter to Appear Twice
Python
class Solution:
def repeatedCharacter(self, s: str) -> str:
temp = {}
for i in s:
if i not in temp:
temp[i] = 1
else:
temp[i] += 1
if temp[i] == 2:
return i
댓글남기기