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:

9K
active users

Šimon Tóth

Sunday common C++ interview problem: Smallest interval to cover k sorted sequences.

Given k sequences of sorted integers, determine the smallest closed interval that covers at least one element from each sequence. For intervals of the same size should be ordered based on their lower bound value (i.e. [0,2]<[1,3]).

Solve it yourself: compiler-explorer.com/z/cqKo5W
Solution: compiler-explorer.com/z/eeTMcb