CSES - Subsequence construction

You are given a list of nn integers. Your task is to find the longest increasing subsequence of the list. If there are multiple subsequences of equal length, you can choose any of them.

For example, in the list [4,1,5,6,3,4,3,8][4,1,5,6,3,4,3,8], the longest increasing subsequence contains 44 numbers. The valid subsequences are [1,3,4,8][1,3,4,8], [1,5,6,8][1,5,6,8] and [4,5,6,8][4,5,6,8].

In a file findlis.py, implement the function find_sequence that takes a list of integers as a parameter. The function should return a longest increasing subsequence of the list.

The function should be efficient when 1n1001 \le n \le 100.

def find_sequence(numbers):
    # TODO

if __name__ == "__main__":
    print(find_sequence([1, 2, 3])) # [1, 2, 3]
    print(find_sequence([3, 2, 1])) # [1]
    print(find_sequence([1, 1, 1, 1, 1])) # [1]

    print(find_sequence([1, 8, 2, 7, 3, 6])) # [1, 2, 3, 6]
    print(find_sequence([1, 1, 2, 2, 3, 3])) # [1, 2, 3]
    print(find_sequence([4, 1, 5, 6, 3, 4, 3, 8])) # [1, 3, 4, 8]