Back to problems

Balloon Explosion

Algorithm · Ebay · Hard

Problem Statement You are given an n x n grid where each cell holds a balloon represented by a non‑negative integer (its color). When two or more balloons of the same color are orthogonally adjacent (sharing an edge), they form a group that explodes and disappears. All such groups explode simultaneously. After the explosions, gravity acts on each column independently: any balloon that has an empty cell below it falls straight down until it either lands on another balloon or…

Checking your access…