Find the divisors!
Last updated
Was this helpful?
Last updated
Was this helpful?
define 'currentNum' with init value input -1 (because we will iterate backward)
defined empty array as 'result'
iterate while currentNum > 1
if input divide by current num is integer it's divisor add currentNum in result array
decrease curruntNum -1
if result has property in other words there is some divisor return result array. if not return ${input} is prime