We can use a greedy algorithm, which seeks to cover all the designated points on $L$ with the fewest number of length-2 intervals (for such an interval is the distance one guard can protect). This greedy algorithm starts with $x_0$ and covers all the points that are within distance $2$ of $x_0$. If $x_i$ is the next uncovered point, then we repeat this same covering step starting from $x_i$. We then repeat this process until we have covered all the points in $X$.