For this Question: Given an unsorted array arr[0. n-1] of size N, find the minimum length subarray arr[s. e](where s and e are start and end index) such that sorting this subarray makes the whole array sorted.

Try to solve the question in O(n).The first line of input contains an integer N next line contains N space-separated integers depicting the values of the array.

Constraints:-
1 < = N < = 1000000
0 < = Arr[i] < = 1000000Print the start and end indices(0 indexing) of the minimum subarray that needs to be sorted.Sample Input:-
5
1 3 2 4 5

Sample Output:-
1 2

Explanation: Elements present in subarray at indices 1, 2 after sorting makes the whole array sorted.

Sample Input:-
6
2 1 5 4 9 10

Sample Output:-
0 3, I have written this Solution Code: 
#include <bits/stdc++.h>


using namespace std;

#define MEM(a, b) memset(a, (b), sizeof(a))

#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)

#define IN(A, B, C) assert( B <= A && A <= C)

#define MP make_pair
#define FOR(i,a) for(int i=0;i<a;i++)

#define FOR1(i,j,a) for(int i=j;i<a;i++)

#define EB emplace_back

#define INF (int)1e9

#define EPS 1e-9

#define PI 3.1415926535897932384626433832795
#define max1 1000001
#define MOD 1000000007

#define read(type) readInt<type>()

#define out(x) cout<<x<<'\n'
#define out1(x) cout<<x<<" "
#define END cout<<'\n'

void fast(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
}
int a[max1],b[max1];
signed  main()
{
int n;
cin>>n;
FOR(i,n){
cin>>a[i];
b[i]=a[i];}
sort(a,a+n);
int i=0;
while(a[i]==b[i]){
    i++;
}
out1(i);
i=n-1;
while(a[i]==b[i]){
    i--;
}
out(i);
}
, In this Programming Language: C++, Now tell me if this Code is compilable or not?