▲ 3 r/learnpython
Any way to make this run faster?
"""Finds the longest string of consecutive letters in an inputted string."""
from itertools import groupby
letters_in = input()
grouped_letters = groupby(letters_in)
letters_list = (list(group) for letter, group in grouped_letters)
print(len(max(letters_list, key=len)))
u/Affectionate-Town-67 — 3 hours ago