mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-07-06 18:49:26 +08:00
Fix sphinx/build_docs warnings for dynamic_programming (#12484)
* Fix sphinx/build_docs warnings for dynamic_programming * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Fix * Fix * Fix * Fix * Fix * Fix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
@ -4,11 +4,13 @@ Author : Mehdi ALAOUI
|
||||
This is a pure Python implementation of Dynamic Programming solution to the longest
|
||||
increasing subsequence of a given sequence.
|
||||
|
||||
The problem is :
|
||||
Given an array, to find the longest and increasing sub-array in that given array and
|
||||
return it.
|
||||
Example: [10, 22, 9, 33, 21, 50, 41, 60, 80] as input will return
|
||||
[10, 22, 33, 41, 60, 80] as output
|
||||
The problem is:
|
||||
Given an array, to find the longest and increasing sub-array in that given array and
|
||||
return it.
|
||||
|
||||
Example:
|
||||
``[10, 22, 9, 33, 21, 50, 41, 60, 80]`` as input will return
|
||||
``[10, 22, 33, 41, 60, 80]`` as output
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@ -17,6 +19,7 @@ from __future__ import annotations
|
||||
def longest_subsequence(array: list[int]) -> list[int]: # This function is recursive
|
||||
"""
|
||||
Some examples
|
||||
|
||||
>>> longest_subsequence([10, 22, 9, 33, 21, 50, 41, 60, 80])
|
||||
[10, 22, 33, 41, 60, 80]
|
||||
>>> longest_subsequence([4, 8, 7, 5, 1, 12, 2, 3, 9])
|
||||
|
Reference in New Issue
Block a user