Skip to content

API correction in longest_increasing_subsequence function #407

Closed
@pratikgl

Description

@pratikgl

Description of the problem

In the longest_increasing_subsequence function the output is a list instead of a OneDimensionalArray
(function) longest_increasing_subsequence: (array) -> list

def longest_increasing_subsequence(array):

    ans = [] # this here should be an ODA instead of a list

    last_index = dp[length]
    while last_index != -1:
        ans[:0] = [array[last_index]]
        last_index = parent[last_index]
    return ans

I can work on it and will open a PR.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions