Hey everyone! Can somebody help me to solve New Driver's License problem? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 13

Hey everyone! Can somebody help me to solve New Driver's License problem?

I have implemented this code in c++ but unable to pass some test cases. https://code.sololearn.com/cVl34zLx757i/?ref=app Thanks!

3rd May 2020, 11:53 AM
Viren Varma
Viren Varma - avatar
6 Answers
+ 1
If agents > 4 or you are the first -> output 20.
3rd May 2020, 6:49 PM
Denise Roßberg
Denise Roßberg - avatar
+ 7
Ohh yes! I missed that condition. Now the code is working perfectly. Thank you so much!
3rd May 2020, 7:05 PM
Viren Varma
Viren Varma - avatar
+ 1
Viren Varma Your welcome :)
3rd May 2020, 7:24 PM
Denise Roßberg
Denise Roßberg - avatar
0
Your problem is that you can have more than 5 agents. I am not sure but maybe it is enough if you change nagets == 5 to nagents >= 5.
3rd May 2020, 12:15 PM
Denise Roßberg
Denise Roßberg - avatar
0
Thank you for your help! But it did not worked. Now I have updated the code by sorting the names and just failing 1 test case. Can somebody please help?
3rd May 2020, 4:53 PM
Viren Varma
Viren Varma - avatar
0
But it is a fact that you can get more than 5 agents. And yes, sorting the names is important. Sorry that I did not see that you missed this in your former code.
3rd May 2020, 6:47 PM
Denise Roßberg
Denise Roßberg - avatar