#C9997. Find the First Repeated Character

    ID: 54151 Type: Default 1000ms 256MiB

Find the First Repeated Character

Find the First Repeated Character

Given a string \(S\), your task is to find the first character that appears at least twice in \(S\). In other words, let \(S = s_1s_2\ldots s_n\) and determine the smallest index \(i\) such that there exists a \(j < i\) for which \(s_i = s_j\). If no character repeats, output None.

Note that the check is case-sensitive and all characters (including spaces and special symbols) are considered.

inputFormat

The input consists of a single line containing the string (S). This string may include letters, digits, spaces, and special characters.

outputFormat

Output the first repeated character from the input string. If no such character exists, output the string None.## sample

hello
l