Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ac8d94c

Browse filesBrowse files
Merge pull request seeditsolution#247 from cadwellh5/patch-1
Maximum sum of increasing subsequence
2 parents fcd8815 + d43724d commit ac8d94c
Copy full SHA for ac8d94c

File tree

Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+16
-0
lines changed
Open diff view settings
Collapse file

‎MaxSumOfIncreasinSubsequence‎

Copy file name to clipboard
+16Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ts=int(input())
2+
l3=[]
3+
l1=[]
4+
for j in range (ts):
5+
n=int(input())
6+
l3.clear()
7+
li=list(map(int, input().split()))
8+
for i in range(1,n):
9+
t=li[i-1]
10+
for j in range(0,i):
11+
if(li[i]>li[j]):
12+
t=t+li[j]
13+
l3.append(t)
14+
if(len(l3)!=0):
15+
print (max(l3))
16+
li.clear()

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.