aoc

Advent of Code Solutions
git clone git://git.alexkarle.com.com/aoc
Log | Files | Refs | README | LICENSE

sol.py (286B) [raw]


      1 import sys
      2 
      3 def last_len_uniq(s, i, n):
      4     return len({c for c in s[i-n:i]}) == n
      5 
      6 s = input()
      7 
      8 for i in range(4, len(s) + 1):
      9     if last_len_uniq(s, i, 4):
     10         print(i)
     11         break
     12 
     13 for i in range(14, len(s) + 1):
     14     if last_len_uniq(s, i, 14):
     15         print(i)
     16         break