+ 3
I would try a dictionary/hashmap. key = letter value = counter While you loop over the string you check if the letter is in your dictionary/hashmap: if yes: increment counter, if no: create new key The first letter where counter = 1 is your first letter that is not repeated.
1st May 2022, 6:30 AM
Denise Roßberg
Denise Roßberg - avatar
+ 6
Arvind , it would be helpful if you can do a sample input and output. please also mention if you mean consecutive repetition or repetition in general.
1st May 2022, 6:13 AM
Lothar
Lothar - avatar
+ 5
The count should be 1 if it is not repeated.
1st May 2022, 4:37 AM
Brian
Brian - avatar
+ 4
You can do this by using nested for loops and can be done using hashmaps.
2nd May 2022, 3:04 AM
Arpit Jain
Arpit Jain - avatar
+ 2
please type your project link so we can help you! :)
1st May 2022, 3:11 AM
Decode
Decode - avatar