Skip to content
Home » Archives for leetcode-solution.com » Page 3

leetcode-solution.com

Leetcode 202. Happy Number

We use a map the keep records of all the numbers during the process. If at any time the converted number equals to 1 we return true directly, otherwise if the number appeared earlier we return false instead. Solution