Editorial for DMOPC '19 Contest 4 P0 - Yikes
Submitting an official solution before solving the problem yourself is a bannable offence.
For this problem, it suffices to loop through all the indices and counting the number of non-matching pairs between the two strings. Formally, count all indices ~i~ such that ~A_i \ne B_i~.
If this count is exactly one, it is possible, and otherwise, it is not.