The gap is 6 and the target 10 exceeds it, so there are two solutions, one outside each anchor. The excess is split evenly, (10−6)/2=2 beyond each end.
x=1−2=−1,x=7+2=9
Checking, ∣−1−1∣+∣−1−7∣=2+8=10 and ∣9−1∣+∣9−7∣=8+2=10, so the solutions are −1 and 9.