For this Question: N children are standing in a queue. They are standing in order 1 to N. Heights of all the children are given. For each child find the length of longest subarray in which all the children have height greater than or equal to him. He must also be part of that sub-array.First Line of input contains integer N denoting number of children.
Next line contain N integers denoting height of ith child H[i].

Constraints
1 <= N <= 150000
0 <= H[i] <= 100000Print N space separated integersSample Input
5
1 2 3 4 2

Sample Output
5 4 2 1 4

Explanation: 
For index 1 sub-array is from 1 to 5 
For index 2 sub-array is from 2 to 5
For index 3 sub-array is from 3 to 4
For index 4 sub-array is from 4 to 4
For index 5 sub-array is from 2 to 5

Sample Input
3
6 5 8

Sample Output
1 3 1, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException{
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
		int n = Integer.parseInt(reader.readLine());
		String[] input = reader.readLine().split(" ");
		int arr[] = new int[n];
		int ans[] = new int[n];
		for(int i=0; i<n; i++){
			arr[i] = Integer.parseInt(input[i]);
		}

        for(int i=0; i<n; i++){
            int count = 0;
			for(int j=i-1; j>=0; j--){
                if(arr[j]>=arr[i]) count++;
                else break;
		    }

            for(int k=i+1; k<n; k++){
                if(arr[k]>=arr[i]) count++;
                else break;
		    }

            System.out.print(count+1 +" ");
		}



	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?