need to add non-sorted test samples (e.g. [3,2,1])?
It looks like 1 is being incorrectly sorted as a composite number in the testcases.
I somehow Alfonso's older comment until I saw Tom's newer one.
Alfonso: I've added a non-sorted test sample, and had the problem rescored.
Tom: 1 is neither prime nor composite. I've added instructions on how to handle that.
I had assumed that "in order" meant "in the order provided". If that were the case, then [5 1 3 2 4] would return [5 3 2 1 4]. Maybe you could say you want them sorted rather than in order.
Maybe a test case with a non-sorted input would be nice
Replace NaNs with the number that appears to its left in the row.
2033 Solvers
Calculate the Levenshtein distance between two strings
465 Solvers
Side of an equilateral triangle
2740 Solvers
Is this triangle right-angled?
2995 Solvers
503 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!