161. One Edit Distance

Problem

Return true if strings s and t are exactly one edit (insert, delete, or replace) away from each other.

Given two strings s and t, determine if they are exactly one edit distance apart. An edit is:

  • Insert one character
  • Delete one character
  • Replace one character

Return true if s and t are exactly one edit apart, false otherwise.

Examples
Input: ["ab","acb"]
Output: true
Hints
Related Problems

161. One Edit Distance

Return true if strings s and t are exactly one edit (insert, delete, or replace) away from each other.