Drivers license challenge
I found a solution that works on my machine but not in the app and I canât figure out why... Hereâs my code: string name = Console.ReadLine(); int agents = Convert.ToInt32(Console.ReadLine()); string others = Console.ReadLine(); int endString1 = others.IndexOf(' ', 0); int endString2 = others.IndexOf(' ', endString1 + 1); int endString3 = others.IndexOf(' ', endString2 + 1); string name1 = others.Remove(endString1); string name2 = others.Substring(endString1 + 1, endString2 - 1); string name3 = others.Substring(endString2 + 1, endString3 -1); string name4 = others.Remove(0, endString3); string[] applicants= {name1, name2, name3, name4, name}; Array.Sort(applicants); double place = Array.IndexOf(applicants, name); double groups = Math.Ceiling(place/agents); int minutes = (int)groups *20; Console.WriteLine(minutes); Any ideas why?