-
The ranking of counters is kept in memory.
-
Every time a counter is incremented, the ranking has to be updated too.
-
Different counters may have the same value, hence, they will share the same ranking.
-
The leaders are the counters at first place.
The exercise consists to implement the CounterRank.API
behaviour in the best
possible way, keeping in mind the expected worst case complexity.
For the usage see the following files:
If available in Hex, the package can be installed
by adding counter_rank
to your list of dependencies in mix.exs
:
def deps do
[
{:counter_rank, "~> 0.1.0"}
]
end
Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/counter_rank.