// TODO: This is way too slow - 50s to generate a solution of size 4 (max = 100) public string Solve(string line) { Stopwatch sw = Stopwatch.StartNew(); List <Stage> stages = StageGenerator.GenerateValidStages(4, sw); long t1 = sw.ElapsedMilliseconds; List <Stage> topStages = stages.OrderByDescending(s => s.Score).Take(5).ToList(); long t2 = sw.ElapsedMilliseconds; Console.WriteLine($"Sort stages: {t2 - t1}ms"); foreach (var stage in topStages) { Console.WriteLine(stage); } Console.WriteLine($"{stages.Count} stages"); return(""); }