Problem 162. High school cafeteria

Created by the cyclist

Given an input vector of positive integers, return a row vector with the primes first (in order) and the composites next (also in order).

The number 1 is neither prime nor composite. Put it with the composites for this problem.

Problem Group

48 solvers submitted 139 solutions (2.9 solutions/solver).

Problem Comments

Solution Comments