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: [[110,5,112,113,114],[210,211,5,213,214],[310,311,3,313,314],[410,411,412,5,414],[5,1,512,3,3],[610,4,1,613,614],[710,1,2,713,714],[810,1,2,1,1],[1,1,2,2,2],[4,1,4,4,1014]]
Output: [[0,0,0,0,0],[0,0,0,0,0],[0,0,0,0,0],[110,0,0,0,114],[210,0,0,0,214],[310,0,0,113,314],[410,0,0,213,414],[610,211,112,313,614],[710,311,412,613,714],[810,411,512,713,1014]]
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.