For this Question: You are given an array Arr of N integers. You have to process Q queries on the array. Each query contains L and R, for each query you have to report the number of indices i in the array such that L <= Arr[i] <= R.First line of input contains two integers N and Q representing number of elements in the array and number of queries.
Second line of input contains N integers representing the array Arr.
Next Q lines of input contains L and R for that query.

Constraints 
1 <= N,Q <= 100000
1 <= Arr[i] <= 100000
1 <= L <= R <= 100000For each query you have to print the number of index i in the array such that L <= Arr[i] <= R in a seperate line.Sample input 
10 10
3 6 7 4 9 1 7 10 9 4 
1 9
4 6
4 7
4 6
6 8
5 8
2 6
2 3
9 9
2 5

Sample output
9
3
5
3
3
3
4
1
2
3

Explanation : 
For range 1 to 9 : all indexes except index 8 (with value 10) have values in the range 1 to 9
For range 4 to 6 : indexes 2(with value 6), 4(with value 4) and 10(with value 4) have value in the range 4 to 6, I have written this Solution Code: import java.io.*;
import java.util.*;



class Main {
	public static void main (String[] args) throws IOException{
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String[] strArr = br.readLine().split(" ");
        int N = Integer.parseInt(strArr[0]);
        int Q = Integer.parseInt(strArr[1]);
        int[] arr = new int[100001];
        strArr = br.readLine().split(" ");

        int max = 0;
        for(int i=0; i<N; i++){
            int curr = Integer.parseInt(strArr[i]);
            arr[curr]++;
            if(curr>max){
                max = curr;
            }
        }
        long[] prefixSum = new long[100001];
        long sum = 0;
        for(int i=0; i<=100000; i++){
            sum = sum + arr[i];
            prefixSum[i] = sum;
        }
        for(int i=0; i<Q; i++){
            strArr = br.readLine().split(" ");
            int L = Integer.parseInt(strArr[0]);
            int R = Integer.parseInt(strArr[1]);
            long count = prefixSum[R]-prefixSum[L-1];
            System.out.println(count);
        }
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?