Roivant Sciences interview question

Happy numbers coding challenge