Given an m x n integer matrix board where board[r][c] > 0 represents a color and 0 represents empty:
(
-
A nonzero cell at (r,c) explodes in this round if at least two of its four orthogonal neighbors (up, down, left, right), within bounds, have the same color value as board[r][c].
(
-
Determine all exploding cells simultaneously based on the initial board for this round; set them to 0.
(
-
Then apply gravity: in each column, slide all nonzero values down to the bottom, preserving their relative order, and fill the remaining cells at the top with 0s. Return the matrix after exactly one such round (detect explosions once, remove, then gravity). Implement the function and analyze time and space complexity.