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

65.79% Correct | 34.21% Incorrect
Last solution submitted on Oct 12, 2019

Problem Comments

Solution Comments