diff --git a/maxArthSubArray.c++ b/maxArthSubArray.c++ new file mode 100644 index 0000000..bfe6ba6 --- /dev/null +++ b/maxArthSubArray.c++ @@ -0,0 +1,36 @@ +// max arithmatic subArray +#include"bits/stdc++.h" +using namespace std; + +int main() +{ + int n; + cin>>n; + + int arr[n]; + for(int i=0; i>arr[i]; + } + + int ans = 2; + int pd = arr[1]-arr[0]; + int j=2; + int curr = 2; + + while(j +using namespace std; + +int main(){ + + int mx = -19999999; + int n; + cin>>n; + + int arr[n]; + for(int i=0; i>arr[i]; + } + + for(int i=0; i>n; + + int arr[n+1]; + arr[n] = -1; + for(int i=0; i>arr[i]; + } + + if(n==1) + { + cout<<"1"<mx && arr[i]>arr[i+1]) + { + ans++; + } + mx = max(mx, arr[i]); + } + cout<>n; + + int arr[n]; + for(int i=0; i>arr[i]; + } + + int crntSum = 0; + for(int i=0; i