LogiQuest

99. First Non-Repeating Character Index

EasyHash Map

Print the 0-based index of the first character that occurs exactly once, or -1.

Input format

A single line of lowercase letters.

Output format

The index, or -1.

Example 1

Input

leetcode

Output

0

Example 2

Input

loveleetcode

Output

2

Constraints

1 ≤ |s| ≤ 10⁵

Read input from standard input and print the answer to standard output. Your code is judged against 6 test cases, most of them hidden.

Loading the MyLoginn IDE…