Given n (always odd), return output a that has concentric rings of the 1s and 0s around the center point. Examples:
Input n = 3
Output a is [ 1 1 1
1 0 1
1 1 1 ]
Input n = 5
Output a is [ 1 1 1 1 1
1 0 0 0 1
1 0 1 0 1
1 0 0 0 1
1 1 1 1 1]
Additional test cases have been added.
Do you know if Matrix Patterns II and Sequences & Series III will become badge eligible problem sets? Thanks!
sorry,just test for regexp solution,it really is not a proper way to do cody.
give nth decimal place of pi
So many choices
First non-zero element in each column
Back to basics 3 - Temp Directory
Determine the number of odd integers in a vector
ZigZag matrix with reflected format
Generate binary combinations for a given number of bit(s)
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office