The Prompt Given two input strings, (a) and (b), return (true) if two letters in (a) can be swapped so that the result is equal to (b), otherwise return (false). Note: swapping letters is defined as taking two indices (i) and (j), where (i) is not equal to (j), and swapping the…