Cody

Problem 43995. convert 2D array of ones and zeros to checkerboard array of [1,2] where the original array was ones and zero elsewhere

Given a 2D array of ones and zeros, generate an equivalent sized checkerboard array of ones and twos. The checkerboard pattern starts with 2:

[2,1,2,1,2;
1,2,1,2,1;
2,1,2,1,2];

Then set this checkerboard array to zero wherever the original was zero.

Solution Stats

59.52% Correct | 40.48% Incorrect
Last Solution submitted on Mar 09, 2020

Problem Comments

Problem Recent Solvers14

Suggested Problems

Problem Tags