Pergunta de entrevista da empresa Upside

The coding challenge: identify if a given number is a happy number