Sha256: 13b98407d1f1bad61b04587c975d07fb95bc91ea771272605d2ebc4d1133c889
Contents?: true
Size: 352 Bytes
Versions: 211
Compression:
Stored size: 352 Bytes
Contents
class PrimeFactors { for (num) { const factors=[]; let currentFactor = 2; while (num !== 1) { if (num % currentFactor === 0) { factors.push(currentFactor); num /= currentFactor; currentFactor = 2; } else { currentFactor++; } } return factors; } } export default PrimeFactors;
Version data entries
211 entries across 211 versions & 1 rubygems