Trains the technique from
LeetCode 2965Find Missing and Repeated ValuesThis is an original problem, written from a brief that listed the technique, the difficulty, the topics, the function shape and the input bounds — none of that problem's wording, examples, hints or editorials. The link is there so you can map your practice onto the standard set.
Same function shape, different story and different numbers.
A pottery kiln is loaded with a square tray of tiles laid out in n rows and n columns, given as the integer matrix tray. Before firing, each tile gets a batch stamp, and the batch numbers 1 through n * n should each land on exactly one tile.
The stamping went wrong on this tray: one batch number was pressed onto two tiles and one batch number never reached a tile. Every other batch number sits on exactly one tile.
Return a two-element array [repeated, absent], where repeated is the batch number found on two tiles and absent is the batch number in the range 1 to n * n found on no tile.
Example 1
Batch 4 is stamped on two tiles of this 2 by 2 tray, and no tile carries batch 3.
Example 2
Batch 9 sits on the tile in the top row and again on the tile in the bottom row, and batch 3 is nowhere on the tray.
Example 3
Two tiles carry batch 5, and batch 9 never reached a tile.
The editor is preloaded with this. It matches the parent problem's shape, so a solution that works here transfers to a judge unchanged.
def audit_kiln_tray(tray: list[list[int]]) -> list[int]:public int[] auditKilnTray(int[][] tray)See the step-by-step animation, the intuition, and clean code in every language — free, no credit card.