Complete solution


#1

Complete Solution is here-
#include
using namespace std;
int maxi(int A[],int N)
{
int temp=0;
for (int i=0;i<N;i++){
if(A[i]>=temp){
temp=A[i];
}
}
return temp;
}
int mini(int A[],int N){
int temp=A[0];
for (int i=0;i<N;i++){
if(A[i]<=temp){
temp=A[i];
}
}
return temp;

}
int maxi1(int A[],int N)
{
int b[N]={0};int c[N]={0};
for(int i=0;i<N;i++){
b[i]+=A[i]+i;
c[i]+=A[i]-i;
}
int d=maxi(b,N);int e=maxi(c,N);
int f=mini(b,N);int g=mini(c,N);
int m1=d-f;int m2=e-g;
if(m1>m2){
return m1;}
else{
return m2;}


#2

Kya baat hai kya baat hai kya baat hai, sahi hai