public boolean checkInterleave(int idx1, int idx2, int idx3)
    {
        if (idx1 == -1 && idx2 == -1 && idx3 == -1)
            return true;
        
        if (idx1 >= 0 && in1.charAt(idx1) == out.charAt(idx3)
                && checkInterleave(idx1-1, idx2, idx3-1))
            return true;
        if (idx2 >= 0 && in2.charAt(idx2) == out.charAt(idx3)
                && checkInterleave(idx1, idx2-1, idx3-1))
            return true;       
        
        return false;
        
    }