Problem 702A — Maximum Increase| What is wrong in this Plz HELP I SPENT 2 Days finding bug PLZZZZ HELP.

Revision en3, by ABhinav2003, 2020-06-05 17:56:45
#include<bits/stdc++.h>
using namespace std;

int sub(int a[] , int len)
{
	if(len == 0)
		return 0;
	
	if(a[len-1]<a[len-2])
		return 0;

	return max(1+sub(a , len-1) , sub(a , len-2));
}

int main()
{
	int len;
	cin>>len;
	int a[len];
	for(int i = 0;i<=len-1;i++)
	{
		cin>>a[i];
	}
	int m = sub(a , len);
	cout<<m;
}``[LINK TO THE PROBLEM](https://codeforces.com/problemset/problem/702/A)``

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English ABhinav2003 2020-06-05 17:56:45 95
en2 English ABhinav2003 2020-06-05 17:29:25 6 Tiny change: '\n\n#include' -> '\n#include'
en1 English ABhinav2003 2020-06-05 17:27:24 454 PLZZ HELP (published)