Problem · Array
Rank Teams by Votes
Learn this problemProblem statement
Each vote ranks the same teams from highest to lowest. Rank teams by the number of first-place votes; break ties using second-place votes, then later positions, and finally alphabetical order.
Function
rankTeams(votes: String[]) → StringExamples
Example 1
votes = ["ABC","ACB","ABC","ACB","ACB"]return = "ACB"Team A is always first; C has more second-place votes than B.
Constraints
1 <= votes.length <= 1000- Each vote contains the same distinct uppercase teams.
- There are at most
26teams.
More Atlassian problems
- Planning ProductionOA · Seen Feb 2025
- K-Means ClusteringOA · Seen Feb 2025
- Minimum Sorted Erasure OperationsOA · Seen Jun 2024
- Count Analogous ArraysOA · Seen Mar 2024
- Get Maximum ScoreOA · Seen Mar 2024
- Better Compression 🦀OA · Seen Mar 2024
- Romanizer 🐡OA · Seen Mar 2024
- Flower Bouquets 💐OA · Seen Mar 2024