A happy number: repeatedly replace it with the sum of squares of its digits. If it reaches 1, it's happy. Detect cycles to identify unhappy numbers.
Input: n=19 Output: true (19β82β68β100β1) Input: n=2 Output: false
Unlock hints progressively β start gentle, go deeper only if needed.
Level 1: Gentle Nudge
A subtle direction
Level 2: Approach
The algorithm to use
Level 3: Detailed
Step-by-step guidance
to save progress and use AI features