Cody

Problem 42456. Create an array (n,n) where only diagonal elements are '1' and others are '0'

Create an array (n,n) where only diagonal elements are '1' and others are '0'

EX: n = 3; then Resultant array would be [ 1 0 1

                                0 1 0
                                1 0 1 ]                                 

Solution Stats

69.92% Correct | 30.08% Incorrect
Last solution submitted on Dec 22, 2018

Solution Comments