0
Topple the sandpile
Given a matrix of non-negative integers, return a matrix of the same dimensions, but toppled:
If the matrix doesn't contain any values larger than 4, return it.
Every "cell" that is larger than 3 gets reduced by 4, and all directly neighboring cells (above, below, left, and...