CodingModerately Difficult
Count adjacent swaps during custom string sorting
Filed under ABB
The question
Given an array of strings and a target string, sort the array based on the sum of ASCII values of the first three characters of each string (comparing only with neighboring elements), and count how many times the target string's position is swapped with its adjacent neighbor.
No write-up yet. Related questions below have one.
Related ABB questions
Collected from public candidate posts and coding forums. Updated Nov 2026.