My LeetCode grinding. Trying to do a problem a day.
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

problem.txt 516B

12345678910111213
  1. Write an algorithm to determine if a number is "happy".
  2. 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. Those numbers for which this process ends in 1 are happy numbers.
  3. Example:
  4. Input: 19
  5. Output: true
  6. Explanation:
  7. 12 + 92 = 82
  8. 82 + 22 = 68
  9. 62 + 82 = 100
  10. 12 + 02 + 02 = 1