We are going to bring down an imaginary building with a series of explosions. Our building is a 5x5 matrix of integers ranging 1-9, each representing a single brick.
The challenge is to set of a series of explosions to bring down our building as much as we can, why not! Each brick that is connected (horizontally, vertically, diagonally) to a copy of itself will represent a payload that is going to explode in the next detonation. The bricks above those that are blown to bits will fall down. We will continue these steps untill we cannot demolish the building any further:
Look at the 'building' to find connected copies of integers for an explosion, set of the explosion to let bricks above the explosion fall down to create a new array of digits. If an explosion occured make sure to backfill your 'building' with a zero to represent rising smoke from the ashes. Though, extra imaginary digital kudos if you used actual clouds, e.g:
Your final output, the result of this challenge, should represent the ruins after the last possible detonation with the aforementioned smoke rising from the ashes.
In the case of no possible explosions, sadly output == input. In the occurence of a single big explosion (or multiple explosions for that matter) to bring the whole building down, the result is simply an array of clouds.
Samples:












