A competition awards medals to the winners: gold to first place, silver to second place, and bronze to third place. In the case of ties, these rules apply:
- If two competitors tie for gold, the next competitor gets bronze, and no silver is awarded. If three or more competitors tie for gold, no other medals are awarded.
- If two or more competitors tie for silver, no bronze is awarded.
- If two or more competitors tie for bronze and fewer than three medals have been awarded so far, all who tied for bronze get medals.
Write a function that takes a vector of scores and identifies the winners (i.e., the position of the winning scores in the vector). In this competition, higher scores are better. If a medal is not awarded, set the output to the empty set.
Solution Stats
Problem Comments
2 Comments
Solution Comments
Show comments
Loading...
Problem Recent Solvers17
Suggested Problems
-
Remove all the words that end with "ain"
2734 Solvers
-
Project Euler: Problem 5, Smallest multiple
1679 Solvers
-
Combinations without using nchoosek
141 Solvers
-
Create the following sequence : 0 1 1 4 9 25 64 169 ...
206 Solvers
-
It's going down. We're finding simbers!
90 Solvers
More from this Author329
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
How about a test with 4+ gold winners?
James, I added that test. Thanks.