← Samsung questions

Shortest path visiting all customers and returning to office (TSP)

Filed under Samsung

Given the 2D grid coordinates of an office and N customers (1 <= N <= 9), find the shortest path that starts at the office, visits all N customers, and returns to the office, using Manhattan distance.

You've read your 3 free write-ups

Sign up free to keep reading. Your account opens the first 10 questions of every company.

Related Samsung questions

Collected from public candidate posts and coding forums. Updated Nov 2026.