Help on Déjà vu (code coach) | Sololearn: Learn to code for FREE!

+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

2/13/2020 4:53:26 PM

Vilvoc

9 Answers

New Answer

+6

And don't forget to delete your code so others can't copy your solution.

+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.

+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 =)

+1

Yes indeed, I don't get the good subject in my head.. But yhe validation was working... Strange?

+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

+1

0

Of course yes! Forget each time..

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...

0

Yes ok, you r welcome.