This question evaluates a candidate's ability to implement grid-based simulation and connected-group detection, including repeated removals, state updates under gravity, termination conditions, and complexity analysis.

Implement a match-3 board resolver. Given an m×n grid of characters representing colors, repeatedly remove any connected group of three or more of the same color aligned horizontally or vertically (allow chain reactions). After each removal, apply gravity so cells fall down to fill gaps; empty cells appear at the top as blanks. Return the final board state and the total number of cells removed. Discuss data structures, detection of groups, gravity implementation, termination conditions, and time/space complexity.