def lenlis(l):
    n=len(l)
    dp=[1]*n
    for i in range(1,n):
        for j in range(0,i):
            if(l[i]>l[j]):
                dp[i]=max(dp[i],dp[j]+1)
    return max(dp)

l=[10, 22, 9, 33, 21, 50, 41, 60]
print(lenlis(l))

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: