Balloon Explosion

Given an n*n grid that contains balloons of different colors (numbers), if two or more adjacent balloons in four directions (up, down, left, right) have the same color, they can explode. After explodi...

Example

Unlock to view complete problem details

and practice with sample input/output

Was this article helpful?

View Test Cases & Run Code requires membership

Standard Input
Execution Result: