Hacker News new | past | comments | ask | show | jobs | submit login

You don't need to append 'p' in the inner while loop more than once. Maybe instead of an array for keeping the list of prime factors do it in a set.



It’s valid to return the multiplicity of each prime, depending on the goal of this.





Consider applying for YC's Summer 2025 batch! Applications are open till May 13

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: