MAXIMUM LENGTH BIOTONIC SUBARRAY unresolved

test case failed wrong answer

for(int i=1;i<n;i++)
{
for(int j=0;j<i;j++)
{
if(ar[j]<ar[i])
{
lis[i]=max(lis[i],lis[j]+1);
}
}
}

there is no requirement of the inner loop and the statement you have written inside the inner loop is not adding any sense to the concerned problem. I have the solution but i would suggest you to perform dry run(using pen and paper) on the input 12,4,78,90,45,23,21. the output is 6. This would help you to understand whether the code you have written is satisfying the logic you want to implement or not.

your code is correct expect the nested loop you have applied.
if you still have doubts, feel free to ask.