Available question text
Place numbers 1..k into a k×k grid (one per cell) so that given pairs enforce which number must appear in a strictly higher row or strictly more leftward column; return any valid matrix or empty if impossible. The core challenge is checking for cycles and deriving compatible row and column orders (via topological sort) and then mapping numbers to positions.
Related questions
Continue with questions that share topics or the same question type.
Sources · 1 reference
These records explain where the question appears. A company tag or candidate report does not guarantee a future interview question.
Hello Interview · 1 record
No company association
Leetcode 2392. Build a Matrix With Conditions
Reported date not specified · 0 source reports
Source snapshot: Nov 12, 2026
View source