Find names similar by one swap
DoorDashSoftware Engineer · Technical ScreenLast updated
This question evaluates string manipulation, character-frequency analysis, and algorithmic reasoning to determine near-matches under a single-character-swap constraint.
Question
LeetCode 859. Buddy Strings – Given a target string and a list of strings, return all list entries that can match the target by swapping at most one pair of characters in each entry.
Solution walkthrough is for members
Get the full walkthrough with reference code and complexity analysis, plus Kitty Coach at 300 messages a day. Hints, the code runner and community answers stay free.