Solution to First No Repeating Char from Jobdu

1 Sep

Question (in Chinese):

Question Name: First No Repeating Char

Question Description: Given a string with only upper-case letters, find the first non-repeating char.

Input: the input might contain multiple test cases. Each line is a test case. Only upper-case letters are used in the test cases.

Output: If there is a non-repeating char, print its index; otherwise, print “-1”.

The solution is:

Leave a Reply

Your email address will not be published. Required fields are marked *

Please put your code into a <pre>YOUR CODE</pre> section. Thanks and Happy Coding!