Company: Visa_10june
Difficulty: medium
Bubble Explosion Problem Description Imagine you are given a board of cells, each containing a bubble of a specific color. Neighboring cells of the bubble are defined as adjacent cells (on either the same row or column as the given cell) which have a common side with the given cell. For example, the neighboring cells for each of the cells A, B, and C are highlighted in corresponding color in the picture below. Your task is to perform a bubble explosion on the board. A bubble explosion is defined by the following rules: A bubble within any given cell is eligible to explode if it has the same color as bubbles in at least 2 neighboring cells. All eligible bubbles and bubbles of the same color in neighboring cells are marked for explosion. All marked bubbles explode at the same time. Exploded bubbles are removed from the board, resulting in empty cells. After all exploded bubbles are removed, remaining bubbles in cells above the empty cells drop down to fill all empty cells. You are given