[mypy] Fix type annotations for dynamic programming (#4687)

* Fix mypy error for knapsack.py

* Fix mypy error for longest_increasing_subsequence

* Fix mypy error for fractional_knapsack_2.py
This commit is contained in:
imp
2021-09-03 17:49:23 +08:00
committed by GitHub
parent 757d4fb84f
commit c1b15a86ba
3 changed files with 7 additions and 14 deletions

View File

@ -36,7 +36,7 @@ def longest_subsequence(array: list[int]) -> list[int]: # This function is recu
pivot = array[0]
isFound = False
i = 1
longest_subseq = []
longest_subseq: list[int] = []
while not isFound and i < array_length:
if array[i] < pivot:
isFound = True