You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<h2><ahref="https://leetcode.com/problems/happy-number">202. Happy Number</a></h2><h3>Easy</h3><hr><p>Write an algorithm to determine if a number <code>n</code> is happy.</p>
2
+
3
+
<p>A <strong>happy number</strong> is a number defined by the following process:</p>
4
+
5
+
<ul>
6
+
<li>Starting with any positive integer, replace the number by the sum of the squares of its digits.</li>
7
+
<li>Repeat the process until the number equals 1 (where it will stay), or it <strong>loops endlessly in a cycle</strong> which does not include 1.</li>
8
+
<li>Those numbers for which this process <strong>ends in 1</strong> are happy.</li>
0 commit comments