Comment

Comment by AndyD1st

Interesting article, but ironically the interviewee's solution is still incorrect at the end of his post. You'll notice that he only squares the first digit, and then adds the second digit rather than squaring it.

E.g. when he calls (happy 97) it prints 88. However, that's 9^2 + 7, when in fact the answer is 9^2 + 7^2 = 130.

parent AndyD1st 11 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton