Cody

Problem 44096. Matrix game: Winner takes all

Given a matrix A, return a new matrix of the same size in which the biggest element of each column in A takes 1, and 0 for all the others. So if:

input A = [5 4 3;
           1 5 6;
           3 0 9]
output a = [1 0 0;
            0 1 0;
            0 0 1]

Solution Stats

81.48% Correct | 18.52% Incorrect
Last Solution submitted on Feb 06, 2019