Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Third, while solution in Clear category for Long Pressed by Wartem
def long_pressed(text: str, typed: str) -> bool:
if text == typed:
return False
i, j = 0, 0
while i < len(text) and j < len(typed):
if text[i] == typed[j]:
i += 1
elif j == 0 or typed[j] != typed[j - 1]:
return False
j += 1
return i == len(text) and j == len(typed)
Nov. 8, 2023
Comments: