Boston numbers doubt


sir please check where am i getting tle?

the problem was you were checking for any prime factor only once.
for eg. 9 = 3 x 3, but your code will produce 3 only once and add it only once.

I fixed your code: https://ide.codingblocks.com/s/212746

this approach can be made still better in terms of time complexity. as you can generate prime numbers(for prime factors) in a more better way using “prime seive” method.

thanks