For this Question: An integer x is called suffix of integer y if binary form of x is suffix of binary form of y.
For example, 3 (binary = 11) is suffix of 7( binary = 111) and 11 ( binary = 1011).

You are given an integer array of size n and an Integer x. You have to count the number of integers y in the given array such that x is suffix of y.

<b>NOTE</b> : Leading zeroes are not considered in binary form for this problem .
For example : 5 in binary is 101 , not 0101 .First line contains n.
Second line contains n space separated.
Next line contains a single integer x.

<b> Constraints </b>
1 <= n <= 10<sup>5</sup>
1 <= arr[i], x = 10<sup>9</sup>A single integer denoting the required answer.Input:
5
11 13 3 9 7
3

Output:
3

Explanation :
11 => 1011
13 => 1101
3 => 11
9 => 1001
7 => 111

3 in binary form is "11". 3 is suffix of [ 11, 3, 7 ]., I have written this Solution Code: import java.io.*;
import java.util.*;

public class Main {
    private static boolean isSuffix(int x,int y){
        while(x>0 && y>0){
            if(x%2 != y%2)return false;
            x/=2;
            y/=2;
        }
        return x==0;
    }
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        OutputWriter out = new OutputWriter(outputStream);
        
        int n=Integer.parseInt(in.next());
        int [] a = new int[n];
        for(int i=0;i<n;i++){
            a[i] = Integer.parseInt(in.next());
        }
        int x=Integer.parseInt(in.next());

        int ans=0;
        for(int i=0;i<n;i++){
            if(isSuffix(x,a[i])){
                ans++;
            }
        }
        out.print(ans);
        out.close();
    }

    
    static class InputReader {
        BufferedReader reader;
        StringTokenizer tokenizer;
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

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

    }

    static class OutputWriter {
        private final PrintWriter writer;

        public OutputWriter(OutputStream outputStream) {
            writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(outputStream)));
        }

        public OutputWriter(Writer writer) {
            this.writer = new PrintWriter(writer);
        }

        public void print(Object... objects) {
            for (int i = 0; i < objects.length; i++) {
                if (i != 0) {
                    writer.print(' ');
                }
                writer.print(objects[i]);
            }
        }

        public void println(Object... objects) {
            print(objects);
            writer.println();
        }

        public void close() {
            writer.close();
        }

        public void println(int i) {
            writer.println(i);
        }

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