public static int d(char char1, char char2){
        if( (char1 == 'h' || char1 == 'w') && char1 != char2){
            return 1;
        }
        else {
            return r(char1, char2);
        }
    }