Sha256: 3097343a5f9675634a22ed55b3dd5b75d09512c78cf70c8e8955fbe0a7db457b
Contents?: true
Size: 323 Bytes
Versions: 137
Compression:
Stored size: 323 Bytes
Contents
export default function calculatePrimeFactors(num: number): number[] { const factors = [] let currentFactor = 2 while (num !== 1) { if (num % currentFactor === 0) { factors.push(currentFactor) num /= currentFactor currentFactor = 2 } else { currentFactor++ } } return factors }
Version data entries
137 entries across 137 versions & 1 rubygems