← Samsung questions

Shortest Longest Distance to Rare Elements

Filed under Samsung

Given an N x N grid of roads (1) and unexplored areas (0), and a set of rare element coordinates, find a road cell that minimizes the maximum shortest-path distance to all rare elements.

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.