public void GetMaxProfit_Sample_356()
        {
            var prices = new int[] { 23171, 21011, 21123, 21366, 21013, 21367 };
            var solver = new MaxProfit();

            var maxProfit = solver.GetMaxProfit(prices);

            maxProfit.Should().Be(356);
        }
Exemple #2
0
        public static void callMaxProfit()
        {
            MaxProfit prb = new MaxProfit();

            Console.WriteLine(prb.GetMaxProfit(new int[] { 7, 6, 4, 3, 1 }));
        }