here is my idea implemented in python:

def LIS(x):

n = len(x)

dp = [{i} for i in x]

for i in range(n - 2, -1, -1):

longest = 0

index = i

for j in range(i + 1, n):

if (x[j] > x[i]):

if (len(dp[j]) > longest):

longest = len(dp[j])

index = j

Read more… (9 words)