Happy Number
Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1.
Happy Number

Write an algorithm to determine if a number n is happy. A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the squares of its digits, and repeat the process until the number equals 1 (where it will stay), or it loops endlessly in a cycle which does not include 1.

Example 1:
Input: 19
Output: true
Input
arr =19

Is 19 a happy number?

Current Number

19

Numbers seen (cycle detection)
Happy (1)
Cycle (Not Happy)
Variables
No variables to display
DepthFunction Call
Stack empty
0/5