index.tsx272 chars16 lines
Explanation: We start with the smallest prime factor and keep dividing the number by it until the number is no longer divisible by that factor. Then we move on to the next prime factor and repeat the process until we reach the largest prime factor. Finally, we return the largest prime factor which is the result of the algorithm.
gistlibby LogSnag