Standard Competition Ranking (SCR) is the system whereby people on a leaderboard are given positions, while taking the possibility of ties into account.
For example, a naïve leaderboard won't know what to do when more than 1 user has the same amount of points. They're all in the same position, yet won't be ranked as such.
SCR makes it so everyone who is in the same position, appears in the same position. It also goes a step further and pushes the person behind them in the rankings the respective number of places backwards.
Eg. instead of having
1, 2, 3, 4, 5, you might have
1, 2, 3, 3, 5, or
1, 1, 1, 1, 5.
That's basically it.
So, because this isn't the easiest or most trivial problem to solve, have a basic class to do it for you. It's nowt special, but it works (and has some test coverage):
PS. This may or may not balk with anything approaching a large dataset, so you'll want to apply a liberal dose of caching to it (or even optimisation) when you're doing something a bit more strenuous than top 10s or whatever.