Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jan 12, 2025
commit 8cb965f1eab0887550d09c3b7103ca35f0a9a379
4 changes: 2 additions & 2 deletions dynamic_programming/longest_increasing_subsequence.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ 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 doesnt
# The sub_sequence which is longer will be 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