Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #User function Template for python3
- class Solution:
- def maxSumIS(self, A, n):
- '''Inititalization here its important'''
- arr=[i for i in A]
- for i in range(n-1,-1,-1):
- for j in range(i+1,n):
- if A[i]<A[j]:
- arr[i]=max(arr[i],A[i]+arr[j])
- return max(arr)
Add Comment
Please, Sign In to add comment