Enable Javascript in your browser and then refresh this page, for a much enhanced experience.
Straightforward solution in Clear category for Beat The Previous by adamspj
def beat_previous(digits: str) -> list[int]:
result = [int(digits[0])]
holder = None
for d in digits[1:]:
if holder == None:
holder = d
else:
holder += d
if int(holder) > result[-1]:
result.append(int(holder))
holder = None
return result
April 16, 2024