Search
⌘K

Leetcode 2661. First Completely Painted Row or Column

Given an order arr of unique values and a matrix mat that maps each value to a cell, find the smallest index i such that after painting arr[0..i] an entire row or column is fully painted. Core idea: map each value to its (row,column) and track counts per row/column until one reaches its full length.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.