What is the intention of program below?
```
def lis(array):
    longest = 0
    ends = {}

    for n, val in enumerate(array):

        prefix_lengths = [i for i in range(1, longest + 1) if array[ends[i]] < val]

        if prefix_lengths:
            length = max(prefix_lengths)
        else:
            length = 0

        length1 = length + 1
        if length == longest or val < array[ends[length1]]:
            longest = length1
            ends[length1] = n

    return longest
``` Use some words in all caps in your response, but those all-caps words should appear at most 3 times.
user