Problem
Find the first non-repeating character in a given String and return it's index. If it doesn't exist, return -1.
Solution
We can execute the logic in two steps
- Find the frequencies of every letter how many times they appear in the string
- Using those frequencies find the the first letter which has value as 1
We need to use a Map to keep track of the first index of a letter and separate storage to maintain the frequency count.
Example code is as below:
Slot Search - Las Vegas, NV - Mapyro
ReplyDeleteLas Vegas, NV 동두천 출장샵 - Slots 동두천 출장샵 Search. 서산 출장안마 Las Vegas, NV. 777 Casino Drive. Las 충주 출장안마 Vegas, NV 89109, USA. 777 Casino Drive. Mapyro. 군포 출장마사지