Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

il y a 5 ans
il y a 5 ans
il y a 5 ans
il y a 5 ans
12345678
  1. import sys
  2. from itertools import groupby
  3. A, B = [int(n) for n in sys.stdin.read().split('-')]
  4. strings = [str(n) for n in range(A, B + 1)]
  5. print(sum(list(s) == sorted(s) and any(len(list(vs)) >= 2 for k, vs in groupby(s)) for s in strings)) # noqa
  6. print(sum(list(s) == sorted(s) and any(len(list(vs)) == 2 for k, vs in groupby(s)) for s in strings)) # noqa