Back to problems

Safe Travel Ranges

Algorithm · Google · Medium

You are given integer pairs (c, r), with each pair describing a planet whose gravitational reach extends from c - r through c + r. Return every interval of space that lies outside the gravitational reach of all planets. Example The planets affect [1, 3], [4, 8], and [10, 12], so the remaining portions of space are safe for travelers.

Checking your access…