Merge tag suggestions without losing priority

Normalize duplicate tag candidates, keep the strongest score per tag, and render a deterministic ranking.

SwiftCollections

Practice

An editor form receives tag suggestions from multiple sources. The same tag can arrive with different casing, extra whitespace, and different confidence scores.

Build the ranked display list. The interview point is that deduplication alone is not enough: the UI needs a clear rule for which duplicate wins and a deterministic order for ties.

swift 5.2

Edit the starter code, then Run to compile it and check your answer. Runs Swift 5.2 on the server (Linux); UIKit, SwiftUI, and long-running async are not supported.