Cody

Problem 2177. Rainbow matrix

Created by Simon in Community

Create a "rainbow matrix" as described in the following examples

 Input = 3
 Output = [ 1 2 3
            2 3 2 
            3 2 1 ]
 Input = 5
 Output = [ 1 2 3 4 5
            2 3 4 5 4
            3 4 5 4 3
            4 5 4 3 2
            5 4 3 2 1 ]

Solution Stats

65.35% Correct | 34.65% Incorrect
Last solution submitted on Jun 17, 2019

Problem Comments

Recent Solvers56

Suggested Problems

Tags