Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
First solution in Clear category for Count And Say by Buggerman
from itertools import groupby
def count_and_say(digits: str) -> str:
return "".join(str(sum(1 for _ in cnt)) + dig for dig,cnt in groupby(digits))
June 20, 2024
Comments: