#C13010. First Repeated Character
First Repeated Character
First Repeated Character
You are given a string \(s\). Your task is to find the first character in the string that repeats, ignoring the case of the letters. Specifically, you should scan the string from left to right and determine the first character that appears at least twice when case is ignored. If there is no repeated character, output None
.
Note: When comparing characters, the letter 'A' and 'a' should be considered the same.
Examples:
- For input
aabc
, the output should bea
because the second character 'a' repeats. - For input
Hello
, the output should bel
because ignoring the case, 'l' is the first character that repeats. - For input
abc
, there is no repeating character so the output should beNone
.
inputFormat
The input consists of a single line containing the string \(s\). The string may contain spaces, letters, and other printable characters.
outputFormat
Output the first repeated character (ignoring case). If there is no such character, output None
.
aabc
a