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.
Alphabetize by last name
Specific Element Count
Sum the elements in either diagonal of a square matrix
Will there be a new leader?
04 - Scalar Equations 2
Put Two 1D matrices into one 1D matrix
Generate binary combinations for a given number of bit(s)
Make combination of two given matrices.
COUNT VOWEL 2
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