-
Notifications
You must be signed in to change notification settings - Fork 0
moroniq/happy_numbers
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
ย | ย | |||
ย | ย | |||
ย | ย | |||
Repository files navigation
๐ Happy Numbers โ Learning Journey This notebook shows my step-by-step process of understanding the Happy Numbers problem in Python. ๐งฉ A happy number is a number that eventually reaches 1 when repeatedly replaced by the sum of the squares of its digits. ๐ง What this notebook includes: manual breakdown of the process (my first approach) early experiments with strings and digit extraction final working loop version using a while loop and a set to track visited numbers ๐ก Example output: n = 19 โ 82 โ 68 โ 100 โ 1 Your number is happy ๐ n = 113 โ ... โ 4 โ 16 โ 37 โ ... (cycle) Your number is unhappy ๐ ๐ Concepts practiced: working with while loops iterating through digits using sets to detect cycles building logic step by step ๐งญ This version is intentionally imperfect โ it shows the way I think through problems, not just the final code.
About
๐งฎ My learning version of the Happy Numbers problem โ step by step from manual logic to working code ๐ก
Topics
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published