← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given a list of lampposts on a straight street, each described by its position and illumination range. Every lamppost at position p_i with range r_i lights the continuous segment [p_i – r_i, p_i + r_i]. The union of all these segments is the only part of the street that must remain lit. Your task is to remove the maximum number of lampposts while guaranteeing that the union of the remaining lampposts is exactly the same as the union of the original set. Return the largest possible number of lampposts that can be removed.