2351. First Letter to Appear Twice
Содержание
class Solution:
def repeatedCharacter(self, s: str) -> str:
mask = 0
for c in s:
i = ord(c) - ord('a')
if mask >> i & 1:
return c
mask |= 1 << i