Login using Social Account
     Continue with GoogleLogin using your credentials
Given two strings s and t, return True if they are both one edit distance apart, otherwise return False.
A string s is said to be one distance apart from a string t if you can:
s to get ts to get ts with a different character to get tExample 1:
Input: s = "ab", t = "acb"
Output: True
Explanation: We can insert 'c' into s to get t.
Example 2:
Input: s = "", t = ""
Output: False
Explanation: We cannot get t from s by only one step.
Example 3:
Input: s = "a", t = ""
Output: True
Example 4:
Input: s = "", t = "A"
Output: True
is_one_edit_distances and tComplete the below code in the right side coding panel
def is_one_edit_distance(s: str, t: str) -> bool:
    # your code goes here
 
            Taking you to the next exercise in seconds...
Want to create exercises like this yourself? Click here.
No hints are availble for this assesment
Note - Having trouble with the assessment engine? Follow the steps listed here
Loading comments...