Exemplo n.º 1
0
        public void BuySellStock15()
        {
            var response = BuyAndSellStock.MaxProfit(new int[] { 5, 32, 4, 29, 1, 39, 40 });

            Assert.AreEqual(39, response);
        }
Exemplo n.º 2
0
        public void BuySellStock2()
        {
            var response = BuyAndSellStock.MaxProfit(new int[] { 7 });

            Assert.AreEqual(0, response);
        }
Exemplo n.º 3
0
        public void BuySellStock14()
        {
            var response = BuyAndSellStock.MaxProfit(new int[] { 2, 7, 1, 4 });

            Assert.AreEqual(5, response);
        }
Exemplo n.º 4
0
        public void BuySellStock13()
        {
            var response = BuyAndSellStock.MaxProfit(new int[] { 2, 1, 2, 1, 0, 0, 1 });

            Assert.AreEqual(1, response);
        }
Exemplo n.º 5
0
        public void BuySellStock12()
        {
            var response = BuyAndSellStock.MaxProfit(new int[] { 3, 2, 6, 5, 0, 3 });

            Assert.AreEqual(4, response);
        }
Exemplo n.º 6
0
        public void BuySellStock11()
        {
            var response = BuyAndSellStock.MaxProfit(new int[] { 9, 8, 9, 7, 1 });

            Assert.AreEqual(1, response);
        }
Exemplo n.º 7
0
        public void BuySellStock8()
        {
            var response = BuyAndSellStock.MaxProfit(new int[] { 7, 6, 8, 3, 1 });

            Assert.AreEqual(2, response);
        }