📅  最后修改于: 2022-03-11 15:04:21.435000             🧑  作者: Mango
// day 25 running time and complexity hackerrank solution javascript
function processData(input) {
//Enter your code here
input.split('\n').slice(1).map((n, i) => {
console.log(isPrime(n) ? 'Prime' : 'Not prime');
});
function isPrime(n) {
if (n == 1) return false;
for (let i = 2; i * i <= n; i++) {
if (n % i == 0) return false;
}
return true;
}
}