Angad Sandhu
Search
Browse

202_Happy_Number

Source name
202_Happy_Number.py
# File: Leetcode/Solutions/202_Happy_Number.py

"""
Problem Number: 202
Problem Name: Happy Number
Difficulty: Easy
Tags: Hash Table, Math, Cycle Detection, Neetcode 150
Company (Frequency): Amazon, Google, Facebook, Microsoft, Apple
Leetcode Link: <https://leetcode.com/problems/happy-number/description/>

DESCRIPTION

Determine if repeatedly replacing a number with sum of squares of its digits reaches 1 (happy) or loops.
Approaches:

* Use Floyd's cycle detection or hash set to detect loops.
"""

Browse the library