dp = [[0 for j in range(len(text2) + 1)] for i in range(len(text1) + 1)] for i in range(len(text1) - 1, -1, -1): for j in range(len(text2) - 1, -1, -1): ...
# therefore the length is 4. Note that there may be more # than one LIS combination, it is only necessary for you to return the length. # Your algorithm should run in O(n2) complexity.