Algorithm · Apple · Medium
Requirements Create a service that accepts a positive integer and reports whether it is happy. For each iteration: Replace the current value with the sum of the squares of its decimal digits. Continue applying that transformation. Return true when the sequence reaches 1. Return false when the sequence enters a repeating cycle that does not contain 1. The starter code provides these entry points: isHappySet isHappyFloyd buildHappyTable isHappyLookup Examples Example 1 The…
Checking your access…