Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Better to use TCP, but I like your approach.


- Attempt to factor your integer n into primes...

- Once you have the complete prime factorization, check whether 2 is among its prime factors...

- If 2 is a factor, it’s even; if not, odd.


It's just 2 lines of code, therefore it's fast.

Also I only use the step over command in the debugger




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

Search: