Company: Myntra_20sep
Difficulty: medium
Problem Description You are given a 2D grid represented as a table of cells, where each cell is either water ( '.' ) or an island ( '#' ). Two island cells are considered connected if they are adjacent horizontally or vertically (up, down, left, or right). A connected component is a maximal set of connected island cells. The size of a connected component is the number of cells it contains. You are allowed to perform exactly one operation: select any single row or any single column, and replace every cell in that row or column with an island ( '#' ). Write a query to determine the maximum connected component size of islands that can be formed for each possible single-row and single-column replacement. Schema grid_cells Table: row_id (INTEGER) - The 1-indexed row number of the cell. col_id (INTEGER) - The 1-indexed column number of the cell. cell_type (VARCHAR) - The type of the cell, either '.' (water) or '#' (island). Required Output The output should be a single table containing the m