You are given two strings s1 and s2 of equal length. A string swap operation allows you to choose two indices in a string (not necessarily different) and swap the characters at those indices.
Determine whether it is possible to make the two strings equal by performing at most one string swap on exactly one of the strings. Return TRUE if this is possible, and FALSE otherwise.
Note: The swap is performed on exactly one of the two strings, and you may choose to perform zero or one swap.
Constraints:
s1.length, s2.length
s1.length s2.length
s1 and s2 consist of only lowercase English letters.
The key intuition behind this solution is that for two equal-length strings to become identical after at most one swap, they can either already be equal (zero differences) or differ at exactly
You are given two strings s1 and s2 of equal length. A string swap operation allows you to choose two indices in a string (not necessarily different) and swap the characters at those indices.
Determine whether it is possible to make the two strings equal by performing at most one string swap on exactly one of the strings. Return TRUE if this is possible, and FALSE otherwise.
Note: The swap is performed on exactly one of the two strings, and you may choose to perform zero or one swap.
Constraints:
s1.length, s2.length
s1.length s2.length
s1 and s2 consist of only lowercase English letters.
The key intuition behind this solution is that for two equal-length strings to become identical after at most one swap, they can either already be equal (zero differences) or differ at exactly