Skip to main content
All Questions

Minimum time to collect all plates.

Unlock detailed company stats for this questionUpgrade

Given n plates on a 2D plane, where two plates can be collected together if they share a row or column and are within distance d, find the minimum time to collect all plates. Collecting one plate collects all plates connected to it. Constraints: 1 <= n <= 10^5, 0 <= d, x[i], y[i] <= 10^9. Example: n = 3, d = 1, x = [0, 2, 1], y = [0, 1, 2] -> 3.

Format · Uber HackerRank OA, second problem.

Community answers

No answers contributed by the community yet.

Related courses

Course

Software Engineering Interview Prep

Land your dream software engineering role at Google, Amazon, Microsoft, Meta, Apple, and other top companies. Learn from mock interviews, frameworks, and advice from senior candidates—practice data structures, algorithms, system design, people management, behavioral interviews, and more.

Course

System Design Interviews

Learn how to answer the latest system design questions across product, infrastructure, and AI domains. Features in-depth video examples, written breakdowns, and helpful reference patterns. Watch senior engineers and managers answer these questions in mock interview videos.