Morgan Stanley Interview Question

1. Solve Leetcode 202. Happy Number