Beispiel #1
0
 def test_input_2_1(self):
     prices = [2,1]
     self.assertEqual(solution.maxProfit(prices), 0)
Beispiel #2
0
 def test_inpit_1111(self):
     prices = [1,1,1,1,1,1,1,1]
     self.assertEqual(solution.maxProfit(prices),0)
Beispiel #3
0
 def test_empty(self):
     prices = []
     self.assertEqual(solution.maxProfit(prices), 0)
Beispiel #4
0
from solution import maxProfit

assert maxProfit([7, 1, 5, 3, 6, 4]) == 5

assert maxProfit([7, 6, 4, 3, 1]) == 0

assert maxProfit([1]) == 0

#empty array
assert maxProfit([]) == 0