Bubble Popping Game

Problem Overview

  • Simulate a bubble-popping game on a 2D grid and return the final grid after all operations.
  • Inputs: a grid of bubble colors and a list of pop coordinates; Output: the grid state after processing in order.
  • Rules: popping zero does nothing; popping a bubble also pops same-color diagonal neighbors within bounds; then gravity makes bubbles fall into empty cells.
  • Context: models game mechanics in a bubble board setting.
  • A classic coding interview problem and interview question on grid simulation.

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Input Variables
Execution Result: