Determine whether a number is happy.
Example 1
Input: n = 19
Output: True
Explanation: The chain of sums of squares of digits leads to 1.
Output: True
Explanation: The chain of sums of squares of digits leads to 1.
Example 2
Input: n = 2
Output: False
Explanation: The sequence for 2 enters a cycle and never reaches 1.
Output: False
Explanation: The sequence for 2 enters a cycle and never reaches 1.