+ 2

Help on Déjà vu (code coach)

Hello, the code bellow works on VS2019 on my computer, but failed on Sololearn (Cases 2 and 5).. Don't understand why..? Thanks for your help and possible amelioration! https://code.sololearn.com/c7qclgP74quQ/?ref=app

13th Feb 2020, 4:53 PM
Vilvoc
Vilvoc - avatar
9 Réponses
+ 6
And don't forget to delete your code so others can't copy your solution.
13th Feb 2020, 5:37 PM
Kevin ★
+ 5
Your code works perfectly but you need to read input in order to solve the Code Coach Challenges. You are solving the task only for "sammich". std::string str; std::cin>>str; std::cout << dejaVu(str); That's how you should take input.
13th Feb 2020, 5:06 PM
Kevin ★
+ 1
Ok, thank you, i'll fix it with an user inuput, and maybe "using namespace std;" If the check test need it. Ps: Working =)
13th Feb 2020, 5:32 PM
Vilvoc
Vilvoc - avatar
+ 1
Yes indeed, I don't get the good subject in my head.. But yhe validation was working... Strange?
13th Feb 2020, 6:36 PM
Vilvoc
Vilvoc - avatar
+ 1
Yes it is an easier way to resolve the task like that, but going on a wrong subject.. Can't validate an other time. Thank to you for the indication morever
13th Feb 2020, 6:48 PM
Vilvoc
Vilvoc - avatar
+ 1
🙂
14th Feb 2020, 7:44 PM
Cmurio
Cmurio - avatar
0
Of course yes! Forget each time..
13th Feb 2020, 5:39 PM
Vilvoc
Vilvoc - avatar
0
I think find_first_of will not help you in this task. Make a simple loop for check if two adjacent letters are the same. If yes print Deja Vu. if not print Unique. just like that...
13th Feb 2020, 6:40 PM
Rafik Abdelhak Nadir
Rafik Abdelhak Nadir - avatar
0
Yes ok, you r welcome.
13th Feb 2020, 6:51 PM
Rafik Abdelhak Nadir
Rafik Abdelhak Nadir - avatar