Cold storage hot spots
A cold storage room reports temperatures from a rectangular grid of sensors, one reading per cell in tenths of a degree. A cell is a hot spot when its reading is strictly greater than the reading of every sensor directly above, below, left of and right of it. Sensors on an edge or in a corner simply have fewer neighbours to beat, and diagonal neighbours never count. Return the coordinates of every hot spot as [row, column] pairs, ordered by row and then by column. A tie with any orthogonal neighbour disqualifies a cell, so a room where every sensor reads the same has no hot spots at all. A grid with no sensors returns an empty list.
hot_spot_cells(readings: list[list[int]]) → list[list[int]][[[1,2,1],[2,9,2],[1,2,1]]]out[[1,1]][[[5,5],[5,5]]]out[][[[3,1,4],[1,5,9]]]out[[0,0],[1,2]]State your approach and its time/space complexity out loud before you optimize. Handle the edge cases (empty input, duplicates, overflow), and say why you chose this over the brute force. Green tests are the floor, not the grade.
[[[1,2,1],[2,9,2],[1,2,1]]][[1,1]]not run yetsample[[[5,5],[5,5]]][]not run yetsample[[[3,1,4],[1,5,9]]][[0,0],[1,2]]not run yetsample