Happy Number
Easy
Math & Number Theory
Repeatedly replace a number by the sum of the squares of its digits. Print true if the process ends at 1, or false if it loops forever.
Constraints
1 <= n <= 2^31 - 1
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.