Solve a grid based C++ question.
The grid is stored as one row per cell. Return each connected component of active cells, where cells connect horizontally or vertically, but not diagonally. Ignore inactive and unknown cells.
component_row, component_col, cell_count, and cellscomponent_row, then component_col| Column | Type | Description |
|---|---|---|
| row_numPK | INT | One-based grid row coordinate |
| col_numPK | INT | One-based grid column coordinate |
| active | BOOLEAN | Whether the cell is active |