public boolean isOneEditDistance(String s, String t) {
        if (s == null || t == null) return false;

        // let's assume s.length() <= t.length()
        if (s.length() > t.length()) return isOneEditDistance(t, s);

        if (t.length() - s.length() >= 2) return false;
        else if (t.length() - s.length() == 1) return isOneRemoved(s, t);
        else return isOneReplaced(s, t);
    }