Company: Visa_10june
Difficulty: medium
Bubble Explosion Problem Description Picture a grid of cells where every cell holds one colored bubble. A cell's neighbors are the cells directly above, below, to the left, and to the right of it - the ones sharing an edge with it, whether along its row or its column. As an illustration, the neighbor sets for three sample cells A, B, and C would each be highlighted in that cell's own color in an accompanying picture. Your task is to simulate a chain-reaction explosion across the board, governed by these rules: A bubble is eligible to explode if at least 2 of its neighboring cells hold a bubble of the exact same color. Once a bubble is eligible, every same-colored bubble touching it (directly or through the chain) gets marked for explosion too. Every marked bubble explodes simultaneously, leaving its cell empty. Once the explosions clear, the bubbles sitting above each empty cell fall straight down to fill the gap. You are given the starting grid bubbles - a 2D array of integers where e