Cody

Problem 18. Bullseye Matrix

Created by Cody Team in Cody Challenge

Given n (always odd), return output a that has concentric rings of the numbers 1 through (n+1)/2 around the center point. Examples:

 Input  n = 3
 Output a is [ 2 2 2 
               2 1 2
               2 2 2 ]
 Input  n = 5
 Output a is [ 3 3 3 3 3
               3 2 2 2 3 
               3 2 1 2 3
               3 2 2 2 3 
               3 3 3 3 3 ]

Solution Stats

59.19% Correct | 40.81% Incorrect
Last solution submitted on Apr 23, 2018

Problem Comments

Solution Comments

Recent Solvers2417

Tags

MATLAB Online Live Editor Challenge

Win cash prizes and have your live script featured on our website

Learn more