No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.

hace 5 años
hace 5 años
hace 5 años
hace 5 años
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