← Google questions
CodingReported in a candidate post, Jul 2025

Smallest Manhattan distance between x and y cells in a grid

Filed under Google

Given a grid of characters, return the smallest Manhattan distance |r1-r2| + |c1-c2| between any cell marked 'x' and any cell marked 'y'. Return -1 if either marker is missing.

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 Google questions

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