Google Interview Question: Happy Numbers

Celine Surai
2 min readJan 4, 2021

How to solve the Happy numbers problem using Python

Photo by Nick Hillier on Unsplash

The question:

Write an algorithm to determine if a number n is happy.

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.

--

--

Celine Surai

Software engineer. I write about my journey, Machine Learning, Web application development and also Python!