Known happy
Input
n = 19
Output
True
19 -> 82 -> 68 -> 100 -> 1, so 19 is happy.
Full lesson preview
Determine whether a number is happy using hashing or cycle detection.
Problem statement
Task
Examples
Input
n = 19
Output
True
19 -> 82 -> 68 -> 100 -> 1, so 19 is happy.
Input format
Output format
Constraints
Samples
Input
n = 7
Output
True
7 is a known happy number sequence leading to 1.