Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #12510 #12517

Merged
merged 8 commits into from
Jan 12, 2025
Merged
Prev Previous commit
Next Next commit
Fixed Grammer Mistake
  • Loading branch information
XenoBytesX authored Jan 12, 2025
commit 40910bf6a9e3a04f515ac05040d85c38f6896e2d
5 changes: 3 additions & 2 deletions dynamic_programming/longest_increasing_subsequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,9 @@ def longest_subsequence(array: list[int]) -> list[int]: # This function is recu
# Else
pivot = array[0]

# Either the subsequence contains the pivot or it doesnt
# The sub_sequence which is longer will be returned
# Either the subsequence contains the pivot or it does not,
# The longest subsequence is calculated in both cases and
# The longer subsequence is returned
without_pivot = longest_subsequence(array[1:])
with_pivot = [element for element in array[1:] if element >= pivot]
with_pivot = [pivot, *longest_subsequence(with_pivot)]
Expand Down
Loading