Find Bids Lowest in Their Row Yet Highest in Their Column

Last updated: November 29, 2026

Quick Overview

Given a grid of distinct integers, return every value that is the minimum of its row and the maximum of its column.

Meta
Coding & Algorithms
Software Engineer
Meta
November 29, 2026
Software Engineer
Phone Screen
Coding & Algorithms
Easy

0

0

0 solved


Given a grid of distinct integers, return every value that is the minimum of its row and the maximum of its column.

A Meta phone screen warm-up framed as finding a bid that is the cheapest in its auction yet the most expensive across its time slot. The interviewer checks set-based thinking and, ideally, the proof that at most one such cell exists when values are distinct.

What the Interviewer Expects
  • Compute row minimums and column maximums separately
  • Intersect the two sets
  • Prove that at most one such value exists with distinct values
  • Keep it O(RC)
  • Clarify the behavior with duplicates
Key Topics to Cover
Matrix
Sets
Proof by contradiction
Arrays
How to Approach This
  1. Clarify input constraints and edge cases before writing code.
  2. Walk through your approach verbally and confirm with the interviewer before coding.
  3. Start with a brute force solution, then optimize. Mention time and space complexity.
  4. Test your solution with examples, including edge cases like empty input or duplicates.
  5. Consider common patterns: sliding window, two pointers, hash map, BFS/DFS, dynamic programming.
Possible Follow-up Questions
  • Prove there can be at most one answer.
  • What if values can repeat?
  • Return the coordinates instead of the values.
Sharpen Your Skills on Codemia

Practice similar problems with our interactive workspace, get AI feedback, and track your progress.

Practice DSA Problems
Sample Answer
Requirements
  • Grid up to 50 x 50 with distinct integers.
  • Return the qualifying values, in any order....
High-Level Design

A qualifying value must appear in the set of row minimums and in the set of column maximums. With distinct values, a value lives in exactly one cell, so the intersection of the two sets is exactly the...


Submit Your Answer
Markdown supported