I think you want to write A and not x:
assert(isequal(adjacent_averaging(A),B))
test case #2 and 3 should be corrected. Instead of x, it should be A
What elements do you consider the "surrounding arrays"?
Surrounding arrays apparently are the elements right above, below, left, and right the zero elements. Found out by reverse engineering. The x is still a mystery.
More tests please. A lot of solutions assume that 0 can't be in the first (or last) column.
3984 Solvers
589 Solvers
Sum of first n terms of a harmonic progression
260 Solvers
Change the sign of even index entries of the reversed vector
301 Solvers
326 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!