示例#1
0
        public void Example0()
        {
            var sol = new BestTimeToBuyAndSellStockIII();

            var profit = sol.MaxProfit(new[] { 1, 10, 5, 1, 10, 5, 1, 10 });

            Assert.AreEqual(18, profit);
        }
示例#2
0
        public void Example2()
        {
            var sol = new BestTimeToBuyAndSellStockIII();

            var profit = sol.MaxProfit(new[] { 1, 2, 3, 4, 5 });

            Assert.AreEqual(4, profit);
        }
示例#3
0
        public void Example3()
        {
            var sol = new BestTimeToBuyAndSellStockIII();

            var profit = sol.MaxProfit(new[] { 7, 6, 4, 3, 1 });

            Assert.AreEqual(0, profit);
        }
示例#4
0
        public void Example1()
        {
            var sol = new BestTimeToBuyAndSellStockIII();

            var profit = sol.MaxProfit(new[] { 3, 3, 5, 0, 0, 3, 1, 4 });

            Assert.AreEqual(6, profit);
        }