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: import java.io.*;
import java.util.*;



class Main {
	static class FastReader
    {
        BufferedReader br;
        StringTokenizer st;

        public FastReader()
        {
            br = new BufferedReader(new
                     InputStreamReader(System.in));
        }

        String next()
        {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException  e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt()
        {
            return Integer.parseInt(next());
        }

        long nextLong()
        {
            return Long.parseLong(next());
        }

        double nextDouble()
        {
            return Double.parseDouble(next());
        }

        String nextLine()
        {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
	public static void main (String[] args) {
        FastReader sc = new FastReader();
	    int n = sc.nextInt();
		int a[] = new int[n];

		for(int i=0;i<n;i++)
        {
            a[i]=sc.nextInt();
        }
        int []c = Arrays.copyOf(a,n);
       Arrays.sort(c);
       int s = Integer.MAX_VALUE;
       int e = Integer.MIN_VALUE;

       for(int i=0;i<n;i++){
            if(a[i]!=c[i]){
                s=Math.min(s,i);
                e=Math.max(e,i);
            }
       }
	System.out.println(s+" "+e);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?