Sha256: 17425adb036c792825b2ebd754fd2a99061d1a0754dec57378a023064925429d
Contents?: true
Size: 244 Bytes
Versions: 396
Compression:
Stored size: 244 Bytes
Contents
class PrimeFactors def self.for(number) factors = [] divisor = 2 while number > 1 while (number % divisor) == 0 factors << divisor number /= divisor end divisor += 1 end factors end end
Version data entries
396 entries across 396 versions & 1 rubygems