Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
itertools.groupby, what else?! solution in Clear category for Count And Say by Phil15
import itertools as it
def count_and_say(digits: str) -> str:
return ''.join(str(len([*group])) + num for num, group in it.groupby(digits))
Dec. 8, 2023