Given two strings s and t, return true if they are exactly one edit apart. A single edit is an insertion, deletion, or replacement of one character. Pattern focus: Edit distance. This is the simplest non-trivial edit-distance variant and tests boundary handling carefully.
s = first string, t = second string
true if the strings are exactly one edit apart, otherwise false
Example 1:
Input:
s = "ab" t = "acb"
Output:
true
Explanation:
Insert c into ab to get acb in exactly one edit.
Example 2:
Input:
s = "abc" t = "abc"
Output:
false
Explanation:
Zero edits are not allowed.