Ejemplo n.º 1
0
        public void GetRoutes()
        {
            var routes = new RouteList(TestTriangle[0][0]);

            routes.Grow();
            foreach (var route in routes)
            {
                Console.WriteLine(route);
            }
        }
Ejemplo n.º 2
0
        public static void Main(string[] args)
        {
            var routes = new RouteList(Triangle[0][0]);

            routes.Grow();
            var highestSumRoute = routes.OrderBy(route => route.RouteSum).LastOrDefault(route => route.IsValid);

            Console.WriteLine(highestSumRoute == null
                ? $"There is no valid route in the triangle"
                : $"Route with highest sum is {highestSumRoute}");
        }