Cody

Problem 44266. Sort the prime numbers in each row of a 3x3 matrix

Considering a 3x3 matrix A, sort the prime numbers of each row in ascending order. For exemple:

      input A=[5 8 2 4;
               1 11 1 5]
output B=[2 8 5 4;
          1 5 1 11]

You don't have to sort the other numbers, just the prime numbers. Enjoy!

Solution Stats

67.57% Correct | 32.43% Incorrect
Last solution submitted on Dec 19, 2018

Problem Comments

Solution Comments