Tourist
Chef is now a tourist in a foreign land. The land can be modelled as an infinite $2$-D grid. Chef is currently at $(A, B)$. There are $N$ attractions, the $i$-th attraction at coordinate $(X_i, Y_i)$. Chef wants to visit $1$ attraction, but he does not care which one. Find the minimum distance Chef needs to travel to reach some attraction. Here, the distance is measured by the Manhattan Metric
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start