For this Question: Given an array of N integers, your task is to calculate the sum of bit difference in all pairs which can be formed.The first line of input contains a single integer N, the second line of input contains N space separated integers depicting values of the array.

Constraints:-
1 <= N <= 100000
0 <= Arr[i] <= 1000000000Print the sum of bit difference of all possible pairs.

Note:- Since the answer can be quite large print your answer modulo 10<sup>9</sup> + 7Sample Input:-
2
1 3

Sample Output:-
2

Explanation:-
(1, 1) = 0
(1, 3) = 1
(3, 1) = 1
(3, 3) = 0

Sample Input:-
2
1 2

Sample Output:-
4, 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));
		int n=Integer.parseInt(br.readLine());
		String str[]=br.readLine().split(" ");
		int a[]=new int[n];
		for(int i=0;i<n;i++){
			a[i]=Integer.parseInt(str[i]);
		}

		long res=0;

        for (int i=0;i<32;i++){
            long cnt=0;
            for (int j=0;j<n;j++)
                if ((a[j] & (1 << i)) == 0)
                    cnt++;

            res=(res+(cnt*(n-cnt)*2))%1000000007;
        }

        System.out.println(res%1000000007);
	}
}, In this Programming Language: Java, Now tell me if this Code is compilable or not?