Yahoo interview question

Leetcode Easy - happy number