Given a string S
, find the first non-repeating character in it and return its index. If it does not exist, return -1.
For example:
type FirstUniqueCharIndex<'abcd'> // 0 type FirstUniqueCharIndex<'abaa'> // 1 type FirstUniqueCharIndex<'aabb'> // -1
Code