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

Tuesday common C++ interview problem: Reaching the last element.

Given an array of positive integers (zero included), determine whether you can reach the final element.

You start at index zero and, in one step, can move at most the value at your current position.

Solve it yourself: compiler-explorer.com/z/1oqfq3
Solution: compiler-explorer.com/z/Mdoq36