Loading...
Loading...
Loading...
In a token queue each token is a small letter. The counter calls the first token whose letter appears only once in the whole queue. Read the queue as a word and print that first unique letter. If every letter repeats, print None.
None.Example 1
Input
swiss
Output
w
s repeats; w is the first letter seen only once.
Example 2
Input
aabbcc
Output
None
Try the problem first. Open one hint at a time.
First pass: count every letter in an int[26].
Second pass: go through the word again in order and stop at the first letter whose count is 1.
Write your Java code, run it on the examples and submit it to hidden tests.
Solve in the editor