Backend Engineer
Senior
programming
Implement a function to determine if two strings are one edit away from being the same string. An edit can be an insertion, deletion, or replacement of a character. Please implement the following function:
def isOneEditAway(first: str, second: str) -> bool:
Constraints:
- 0 <= first.length, second.length <= 100
- Both strings consist of lowercase English letters.
Example 1:
Input: first = "pale", second = "ple"
Output: true
Example 2:
Input: first = "pales", second = "pal"
Output: false
Suggested Answer