Back to problems

One Edit Distance

Algorithm · Apple · Easy

Exactly One Edit Apart Given strings s and t, determine whether they are separated by precisely one edit. Return true when they are, and return false in every other case. Two strings have an edit distance of one when changing s into t requires one and only one of these actions: Insert one character into s so that it becomes t. Remove one character from s so that it becomes t. Substitute one character in s with a different character to produce t. Identical strings do not…

Checking your access…