public static boolean isOneEditDistance(String s, String t) {
		int m = s.length(), n = t.length();
		if (m > n)
			return isOneEditDistance(t, s);
		if (n - m > 1)
			return false;
		int i = 0, shift = n - m;
		while (i < m && s.charAt(i) == t.charAt(i))
			i++;
		if (i == m) {
			if (shift == 0)
				return false; // s ==t
			else
				return true; // s append one letter == t
		}
		if (shift == 0)
			i++; // jump one diff letter
		while (i < m && s.charAt(i) == t.charAt(i + shift))
			i++;
		return i == m;
	}