How would you ascertain if two strings could be identical after zero or one character swaps?

Free for the first 3 answer contributors

Interview question asked to Machine Learning Engineers and Data Scientists interviewing at GitHub, Nubank, AppDynamics and others: How would you ascertain if two strings could be identical after zero or one character swaps?.