hachyderm.io is one of the many independent Mastodon servers you can use to participate in the fediverse.
Hachyderm is a safe space, LGBTQIA+ and BLM, primarily comprised of tech industry professionals world wide. Note that many non-user account types have restrictions - please see our About page.

Administered by:

Server stats:

9.5K
active users

Šimon Tóth

Sunday C++ interview problem.

Implement an O(1) ranking data structure with the following operations:

Increment/decrement key's value, incrementing a non-existent key should add it with value 1; decrementing a key with value 1 should remove it.

Min/Max operations that should return the min/max key.

Solve it yourself: compiler-explorer.com/z/vaPsGs
Solution: compiler-explorer.com/z/eGGdnb