Minimum Sum-of-Distances Meeting Point on a Line

Asked at LinkedIn · Coding Questions · Difficulty: Medium · Last asked Feb 17, 2026

Several stations sit at integer positions on a straight road. You want to put one meeting point on the road so that the total distance from all stations to it is as small as possible. Return that smallest possible total distance.

Loading the problem…