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 ]
1 player likes this solution
1 player likes this solution
6 players like this solution
1 player likes this solution
1 player likes this solution
Tags
Opportunities for recent engineering grads.
Apply Today
42 players like this problem
42 players like this problem