Waiting for answer This question has not been answered yet. You can hire a professional tutor to get the answer.
public staticbooleandifferByOneSwap(java.Strings, java.Stringt) Determines whether s and t differ by having exactly one pair of distinct adjacent...
Determines whether s and t differ by having exactly one pair of distinct adjacent characters reversed. This method is case sensitive. For example,
- differByOneSwap("banana", "banaan") is true
- differByOneSwap("banana", "banana") is false
- differByOneSwap("banana", "bnaaan") is false
- differByOneSwap("apple", "apple") is false
- differByOneSwap("abc", "ba") is false
Parameters:
s - given string
t - given string
Returns:
true if s and t are the same except for one pair of adjacent characters that are switched