Help me with this c++ code. It didn't satisfy 3 out of 12 test conditions. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help me with this c++ code. It didn't satisfy 3 out of 12 test conditions.

https://code.sololearn.com/c0OipWf7BYcu/?ref=app

26th Mar 2021, 6:27 AM
S Srividhya
S Srividhya - avatar
8 Answers
+ 4
S Srividhya your code has two errors, the first is on line 28, when you start the loop you declare i = 1 and it must be i = 0, remember that the positions in the arrays start to count from 0. The second error is in the if of line 37, you wrote count2 == 2 when it should be count2 >= 2
26th Mar 2021, 7:15 AM
Julio Amaro
Julio Amaro - avatar
+ 4
Copy and paste your code here. Don't send any link
26th Mar 2021, 6:32 AM
Atul [Inactive]
+ 3
Tomáš Konečný please don't provide direct answers
26th Mar 2021, 6:53 AM
Atul [Inactive]
+ 2
My solution is here to help to someone who is struggling with the logic, so I keep it here. If they didn't understand the commands, they should search for each single command and learn more about it from documentation. As we usually do in reality.
26th Mar 2021, 1:02 PM
Tomas Konecny
+ 1
You have provided link to the Code Coach problem, not your code. When clicking on it, we are redirected to this Code Coac problem, but with our own solutions (if it is already solved by person that goes by this link). What you should do: go to Code Coach problem, open your code, copy it all, open SoloLearn Playground, press New Code (+), choose your language, remove the default code, paste your code, save and name it and provide the link to the code to us.
26th Mar 2021, 6:32 AM
#0009e7 [get]
#0009e7 [get] - avatar
+ 1
Ok, I will include comments later on.
26th Mar 2021, 2:38 PM
Tomas Konecny
0
You can check out my solution here: https://code.sololearn.com/cziDnPYZuPjg/?ref=app
26th Mar 2021, 6:45 AM
Tomas Konecny
0
Thank you all for helping me to complete the code.
27th Mar 2021, 6:25 AM
S Srividhya
S Srividhya - avatar