You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

13 line
245B

  1. from itertools import groupby
  2. def mod(string):
  3. return ''.join(f'{len(list(vs))}{k}' for k, vs in groupby(string))
  4. inp = df.read_text().splitlines()
  5. for _ in range(50):
  6. inp.append(mod(inp[-1]))
  7. ans1 = len(inp[40])
  8. ans2 = len(inp[50])