Uber·Software Engineer·Technical Phone Screen
- Given an integer matrix and an array of query values, for each query count how many cells are reachable from the top-left cell by moving in four directions through cells whose values are strictly less than the query. Return answers in the original query order.
“My first instinct was to just run a BFS for every query independently.”