Cody

Solution 2189127

Submitted on 2 Apr 2020 by William
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
x = [4 3 2 1 0 1 2 3 4 3 3 2 1 0 1 2 3 3 2 2 2 1 0 1 2 2 2 1 1 1 1 0 1 1 1 1 0 0 0 0 0 0 0 0 0 1 1 1 1 0 1 1 1 1 2 2 2 1 0 1 2 2 2 3 3 2 1 0 1 2 3 3 4 3 2 1 0 1 2 3 4]; assert(isequal(abelian_sandpile_2(4),x))

2   Pass
x = [2 1 0 1 2 1 1 0 1 1 0 0 0 0 0 1 1 0 1 1 2 1 0 1 2]; assert(isequal(abelian_sandpile_2(2),x))

3   Pass
x = [5 4 3 2 1 0 1 2 3 4 5 4 4 3 2 1 0 1 2 3 4 4 3 3 3 2 1 0 1 2 3 3 3 2 2 2 2 1 0 1 2 2 2 2 1 1 1 1 1 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 1 1 1 1 1 2 2 2 2 1 0 1 2 2 2 2 3 3 3 2 1 0 1 2 3 3 3 4 4 3 2 1 0 1 2 3 4 4 5 4 3 2 1 0 1 2 3 4 5]; assert(isequal(abelian_sandpile_2(5),x))