723. Candy Crush

Given a 2D board of integers representing candies, repeatedly crush candies by removing any group of 3 or more identical candies in a row or column. After crushing, candies above fall down to fill the gaps, and new empty spaces at the top are filled with 0s. Continue until no more groups of 3+ can be crushed.

Examples
Input: [[1,1,1],[4,4,4],[2,2,1]]
Output: [[0,0,0],[0,0,0],[2,2,1]]
Hints
Related Problems

723. Candy Crush

Given a 2D board of integers representing candies, repeatedly crush candies by removing any group of 3 or more identical candies in a row or column. After crushing, candies above fall down to fill the gaps, and new empty spaces at the top are filled with 0s. Continue until no more groups of 3+ can be crushed.