# Author Mohd Mujtaba @ Play with C Plus
def LIS(l):
n=len(l);
l1=[1]*n;
for i in range(n):
for j in range(0,i):
if(l[i]>l[j]):
l1[i]=max(l1[j]+1,l1[i]);
print(max(l1));
for _ in range(int(input())):
n=int(input());
l=list(map(int,input().split()));
LIS(l);
def LIS(l):
n=len(l);
l1=[1]*n;
for i in range(n):
for j in range(0,i):
if(l[i]>l[j]):
l1[i]=max(l1[j]+1,l1[i]);
print(max(l1));
for _ in range(int(input())):
n=int(input());
l=list(map(int,input().split()));
LIS(l);
No comments:
Post a Comment