Intel Corporation interview question

they asked me the Happy number question from Leetcode