For this Question: You are given a sequence of n positive integers, and let's say you are filling a stack by adding elements of this sequence one by one starting from the first element. and whenever the element which you are going to add to the stack has set bits equal to the set bits of the top element of the stack, then the top element pops out of the stack and current remains as it is. This operation continues, till the current element set bits are not equal to the set bits of top of the stack.The first line contains single integer n.
The second line contains n space- separated integers.

<b>Constraints:</b>
1 &le; n &le; 10<sup>4</sup>
1 &le; a[i] &le; 10<sup>8</sup>Print final size of stack after all these operations.Sample Input :
4
5 4 2 1

Sample Output :
2

Sample Explanation :
Initially stack is empty, curr element is 5, add 5 to the stack.
stack = 5 , curr element is 4 having 1 set bit, and 5 has 2 set bits, thus, add 4,
stack = 5, 4 , curr element is 2 having 1 set bit and 4 has also 1 set bit, thus pop out 4,
stack = 5, curr element is 2 having 1 set bit and 5 has 2 set bits, thus add 2.
stack = 5, 2, curr element is 1 having 1 set bit and 2 has also 1 set bit, thus pop out 2,
stack = 5, curr element is 1 having 1 set bit and 5 has 2 set bits, thus add 1.
stack = 5, 1
, I have written this Solution Code: import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] arr = new int[n];
        for (int i = 0; i < n; i++) {
            arr[i] = sc.nextInt();
        }
        Stack<Integer> stack = new Stack<>();
        for (int i = 0; i < n; i++) {
            int current = arr[i];
           
                while (!stack.isEmpty() && Integer.bitCount(current) == Integer.bitCount(stack.peek())) {
                    stack.pop();
                }
            
            stack.push(current);
        }
        System.out.println(stack.size());
    }
}
, In this Programming Language: Java, Now tell me if this Code is compilable or not?