Candy Crush Board Stabilization

Given an m x n integer matrix board:

  • board[r][c] = 0 represents an empty cell;
  • a positive integer represents a candy type, and equal values represent equal candy types.

Repeatedly perform ...

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: