public void Test2() { var bs = new StockBuySellToMaxProfit(); int totalProfit = bs.BuyAndSell(new int[] { 4, 3, 2 }); Assert.That(totalProfit, Is.EqualTo(0)); }
public void Test3() { var bs = new StockBuySellToMaxProfit(); int totalProfit = bs.BuyAndSell(new int[] { 1, 1, 1000, 1, 1, 100000 }); Assert.That(totalProfit, Is.EqualTo(100998)); }
public void Test1() { var bs = new StockBuySellToMaxProfit(); int totalProfit = bs.BuyAndSell(new int[] { 100, 180, 260, 310, 40, 535, 695 }); Assert.That(totalProfit, Is.EqualTo(865)); }