Cody

Problem 45369. Sky full of stars - 02

Solution 2996455

Submitted on 27 Sep 2020 at 0:15 by Benjamin
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Pass
a= ['*********' ' ******* ' ' ***** ' ' *** ' ' * ']; assert(isequal(star_pattern_2(5,'t'),a))

2   Pass
a= [' * ' ' *** ' ' ***** ' ' ******* ' ' ********* ' ' *********** ' ' ************* ' ' *************** ' ' ***************** ' '*******************']; assert(isequal(star_pattern_2(10,'b'),a))

3   Pass
a= ['*************************' ' *********************** ' ' ********************* ' ' ******************* ' ' ***************** ' ' *************** ' ' ************* ' ' *********** ' ' ********* ' ' ******* ' ' ***** ' ' *** ' ' * ']; assert(isequal(star_pattern_2(13,'t'),a))

4   Pass
a= ['*']; assert(isequal(star_pattern_2(1,'t'),a))

Suggested Problems

More from this Author149

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!