Leetcode 859. Buddy Strings
Determine whether swapping exactly two characters in s can make it equal to goal: return true if s and goal have the same length and either they differ at exactly two positions whose characters are cross-matching, or they are already equal and s contains a repeated character (so a swap of identical letters is possible).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
0
Hello Interview Premium
Your account is free and you can post anonymously if you choose.