#B2126. Consecutive Character Finder
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:
- The first line contains a non-empty string.
- 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