Editorial for DMOPC '19 Contest 4 P0 - Yikes

Remember to use this editorial only when stuck, and not to copy-paste code from it. Please be respectful to the problem author and editorialist.
Submitting an official solution before solving the problem yourself is a bannable offence.

Author: Riolku

For this problem, it suffices to loop through all the indices and count 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.


There are no comments at the moment.