+ 3
Can anyone help me how can i solve this problem in c++?
Problem link: https://www.sololearn.com/coach/54?ref=app Can Someone give me this problems code in c++? I want to learn it in c++
5 Answers
+ 3
Md Abu Taher
Break the problem into smaller problems and solve little problems until the big problem is solved.
Step 1
Look at each item in the word.
iteration -> for loop or while loop
Step 2
Create an empty string, call it a pot.
If the item you are looking at is not in the pot, then put it in the pot.
if condition & append method +=
Step 3.
Compare the contents of the pot to the original word.
if they are the same -> Unique
else -> Deja Vu
That's it buddy
3 small tasks will solve the big task
+ 4
Please show your code!
+ 3
This will help you if you like it analize:
https://code.sololearn.com/c0zKNSmr4k85/?ref=app
+ 2
Iterate over the string and then use something like unordered map from stl to append the character as key with value 1 in map if only the character isn't stored as key . If the character is stored as key then you can print deja vu and break the loop . Otherwise unique.
+ 1
Lisa
I tried it but it seems hard
Then I didnât write codeđŽ