Cody

Problem 424. Snakes on a plane

Created by Stephen in Community

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

Solution Stats

45.12% Correct | 54.88% Incorrect
Last solution submitted on Apr 25, 2019

Problem Comments

Solution Comments