Pergunta de entrevista da empresa Google

Write an algorithm to find if a number is happy