Problem 61092. Leaderboard Tracker
- S is an m×n matrix of scores, where S(i,j) is the score of player j in match i.
- cumScore is an m×1 vector containing the cumulative score of the current leader after each match.
- leaderIdx is an m×1 vector of indices of the current leader.
Example:
S = [2 3 1; 1 2 3; 0 1 2];
[cumScore, leaderIdx] = leaderboard_tracker(S)
% cumScore = [3;5;6]
% leaderIdx = [2;2;2]
Hints:
- Use cumsum to track cumulative scores.
- Update the leader only if a player’s cumulative score exceeds the current leader.
- In case of ties for a new leader, pick the lowest index.
Solution Stats
Problem Comments
-
1 Comment
Dyuman Joshi
on 30 Dec 2025 at 11:54
This problem is a copy of Problem 61059 and its 1st test case.
@Shreyas, you are advised to update the problem to make it different from already existing problem ASAP.
Otherwise, this problem will be deleted soon.
Solution Comments
Show commentsProblem Recent Solvers6
Suggested Problems
-
6 Solvers
More from this Author1
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!