@@ -0,0 +1,1129 @@
+# This Program gives you Longest increasing subsequence using DP.  %0A%0A# Time complexity: O(n * n)%0A%0A# Input Format:%0A# First line has integer n where n=number of elements in array.%0A# The next  line n integer elements of array.%0A%0A# Output Format:%0A# Print LIS and its length%0A%0Adef find_longest_increasing_subsequence(ar):%0A    dp=%5B%5D%0A%0A    # Initialising the value for first array element%0A    dp.append(1)%0A%0A    for i in range(1,len(ar)):%0A%0A        if ar%5Bi%5D%3Ear%5Bi-1%5D:%0A            # As for any indivisual element minimum length can be 1  for itself%0A            dp.append(1)%0A            # After checking the previous element increementing the count from the counter variable of the previous value itself(DP)%0A            dp%5Bi%5D=dp%5Bi-1%5D+1%0A%0A%0A        else:%0A            dp.append(1)%0A%0A    pos=dp.index(max(dp))%0A    print(%22Longest subsequence array is %22)%0A    #pos+1 because slicing needs +1 for going to the exact position we want to%0A    print(ar%5Bpos+1-max(dp):pos+1%5D)%0A    return max(dp)%0A%0An=raw_input()%0Aarray = %5Bint(x) for x in raw_input().split()%5D%0A%0Aprint(%22Longest Length of increasing subsequence is %22+str(find_longest_increasing_subsequence(array)))%0A

add Program to find LIS