num + 2
and store it in a variable sqrtNumPlusTwo
.i
from sqrtNumPlusTwo
down to 1.
a. If num + 1
is divisible by i
, return [i, (num + 1) / i]
as they are the closest divisors for num + 1
.
b. If num + 2
is divisible by i
, return [i, (num + 2) / i]
as they are the closest divisors for num + 2
.