#B2126. Consecutive Character Finder

    ID: 11208 Type: Default 1000ms 256MiB

Consecutive Character Finder

Consecutive Character Finder

Given a string and an integer \(k\), find the first character in the string that appears consecutively at least \(k\) times.

If no such character exists, output None.

The input consists of two lines: the first line contains the string and the second line contains the integer \(k\>.

inputFormat

The input is given as follows:

  1. The first line contains a non-empty string.
  2. The second line contains an integer \(k\) \( (1 \le k \le n)\), where \(n\) is the length of the string.

outputFormat

Output the first character that appears consecutively at least \(k\) times. If no such character exists, output None.

sample

aabbccc
2
a