Search
⌘K
Get Premium
Leetcode 202. Happy Number
Determine whether iterating n -> sum of the squares of its digits eventually reaches 1 or falls into a repeating cycle; the core task is to detect cycles in this generated sequence (e.g., via a visited set or Floyd's cycle-finding).
Question Timeline
See when this question was last asked and where, including any notes left by other candidates.
All Regions
Comments
Hello Interview Premium
Your account is free and you can post anonymously if you choose.