there is $$$N$$$ number of cites in one dimension. the location of the city is $$$a_{i}$$$ you have to place $$$k$$$ ATM such that the sum of all the cities to its nearest ATM distance is minimum.
I don't remember constraints but it was not big.
the question was asked in Honeywell Hiring Challange(closed).
$$$N = 3$$$
$$$A = [1, 2, 3]$$$
$$$K = 1$$$
$$$ans = 2$$$
Thanks in Advance!