Tap here to switch tabs
Problem
Submissions

Problem: One Edit Distance

med
30 min
Try to solve the One Edit Distance problem.

Statement

Given two strings s and t, return true if they are exactly 11 edit distance apart, otherwise return false.

A string s is considered to be one edit distance away from a string t if it is possible to perform exactly one of the following operations:

  • Insert exactly 11 character into s to obtain t

  • Delete exactly 11 character from s to obtain t

  • Replace exactly 11 character in s with a different character to obtain t

Constraints:

  • 0≤0 \leq s.length, t.length ≤104\leq 10^4

  • s and t consist of lowercase letters, uppercase letters, and digits.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: One Edit Distance

med
30 min
Try to solve the One Edit Distance problem.

Statement

Given two strings s and t, return true if they are exactly 11 edit distance apart, otherwise return false.

A string s is considered to be one edit distance away from a string t if it is possible to perform exactly one of the following operations:

  • Insert exactly 11 character into s to obtain t

  • Delete exactly 11 character from s to obtain t

  • Replace exactly 11 character in s with a different character to obtain t

Constraints:

  • 0≤0 \leq s.length, t.length ≤104\leq 10^4

  • s and t consist of lowercase letters, uppercase letters, and digits.