Find the position of the leftmost character that appears only once in a given string.
A single line containing a string of characters.
The position of the leftmost character in the string that appears only once. Positions are indexed from 0. The integer -1 must be written to the output in case none of the characters appears only once in the string.
Input:
aabbcddd
Output:
4
Input:
aabbcccddd
Output:
-1