Roivant Sciences interview question

Happy numbers coding question