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.
Sort a list of complex numbers based on far they are from the origin.
What's Your BMI?
Is the input divisible by 3?
Area of an Isoceles Triangle
Generate binary combinations for a given number of bit(s)
ZigZag matrix with reflected format
THE TOUGHEST PROBLEM????
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