~/algor $ cat contests/round-5/E
E. First repeated letter
Problem E
ICPC rules
1000 ms
64 MB
A string is given. Reading it left to right, find the first letter that has already occurred before. If there is no such letter (all letters are distinct), print NO.
Input
One line containing the string .
Output
One letter or NO.
Note
consists of lowercase Latin letters (a–z) only
Examples
Input #1
dasturlash
Output #1
a
Input #2
olma
Output #2
NO