C# How to make a New Driver's License Code Coach For Loop work? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

C# How to make a New Driver's License Code Coach For Loop work?

In the attached code is a section that says 'Failure for unknown reason.' When ran it passes 4 of the 5 tests for the Code Coach Challenge but I do not know why it is failing the 5th test. Why does it fail the scenario/ could it be solved with just the 1 for loop? I ended up giving up and going with if statements instead in my 'Working Solution' but I would like to get the loop to work instead. The program explains the scenario it is solving. https://code.sololearn.com/c1WiXtn65p30/?ref=app

13th Feb 2021, 7:35 PM
Elijah Brown
Elijah Brown - avatar
1 Answer
0
I've created a list: List<string> drivers = new List<string>(Console.ReadLine().Split(' ')); Then used List.Add() and Sort() methods without if statements and for loops.
25th Feb 2021, 10:13 AM
Vladimir {Tomsk}
Vladimir  {Tomsk} - avatar