예제 #1
0
파일: test.py 프로젝트: shz117/Leetcode
 def test_input_2_1(self):
     prices = [2,1]
     self.assertEqual(solution.maxProfit(prices), 0)
예제 #2
0
파일: test.py 프로젝트: shz117/Leetcode
 def test_inpit_1111(self):
     prices = [1,1,1,1,1,1,1,1]
     self.assertEqual(solution.maxProfit(prices),0)
예제 #3
0
파일: test.py 프로젝트: shz117/Leetcode
 def test_empty(self):
     prices = []
     self.assertEqual(solution.maxProfit(prices), 0)
예제 #4
0
파일: test_.py 프로젝트: ftlka/problems
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