Junior — Senior
Determining the possibility of transforming a string in a single edit
livecode
Task condition
It is required to implement a function (without class declaration and imports) that takes two strings and returns a boolean indicating whether one string can be obtained from the other using exactly one of the following actions:
- replacing one character;
- inserting or deleting one character.
Examples of input data and expected results:
first = "a", second = "b" -> true
first = "ab", second = "b" -> true
first = "ab", second = "cb" -> true
first = "ab", second = "ba" -> false
public boolean editing(String s1, String s2) {
}