One Switch Strings

One Switch Strings

CheckiO platform has a similar mission Verify Anagrams, but in it you have to determine whether words are anagrams. In this mission, the task will be a little different. You are given two strings and need to determine whether you can swap two letters in the first string to get the second string. If so (or words are the same) - return True, if not - False.

For example, the string "btry", if we swap y and t, we get "byrt".

Input: Two strings (str).

Output: Logic value (bool).

Examples:

assert switch_strings("btry", "byrt") == True
assert switch_strings("boss", "boss") == True
assert switch_strings("solid", "disel") == False
assert switch_strings("false", "flaes") == False

Preconditions:

  • All letters are in lower case;
  • Only letters.