Back to problems

Check Whether a Board Fits Between Blockers

Algorithm · Capital One · Medium

You are given the positions of several obstacles placed on an infinite integer number line. A plank of a certain length can be laid down starting at some integer coordinate, but it cannot cover any obstacle position. Obstacles are fixed and given to you beforehand. Afterwards, you will process multiple independent queries. For each query you receive a starting position start and a positive integer length. The plank occupies the half-open interval: $$[\text{start},\…

Checking your access…