Given the dimensions of a 2-d plane, create a matrix where a "snake" of ones occupies the plane from top left to bottom right.
Example:
0 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 1 1 1 1 1 1 1 1 0 0 1 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0
for m=7, n=10 the m will always be odd and >5 n will be >3
Please show me the unique full size snake in your example, several small snakes of 1s looked at me.
Now saw the snake, thanks.
You need to change the function name to "your_fcn_name" instead of the default "plane" to get it to work with the test suite.
yeah, it depends on what your motivation is. If you want a low complexity, the puzzle is to match the test cases efficiently, but if you want low complexity and want to answer the problem, it adds a degree of difficulty. good solutions either way.
3418 Solvers
Sum of first n terms of a harmonic progression
190 Solvers
230 Solvers
345 Solvers
424 Solvers