private static int[] addBinary(int[] aa, int[] bb){
        int n = aa.length;
        int m = bb.length;
        int lenMax = n;
        int lenMin = m;
        if(m>n){
            lenMax = m;
            lenMin = n;
        }
        int[] addition = new int[lenMax];
        int carry = 0;
        int sum = 0;
        for(int i=0; i<lenMin; i++){
            sum = aa[i] + bb[i] + carry;
            switch(sum){
                case 0: addition[i] = 0;
                        carry = 0;
                        break;
                case 1: addition[i] = 1;
                        carry = 0;
                        break;
                case 2: addition[i] = 0;
                        carry = 1;
                        break;
                case 3: addition[i] = 1;
                            carry = 1;
                        break;
            }
        }

        return addition;
    }