Skip to content

Instantly share code, notes, and snippets.

View tuesd4y's full-sized avatar

Chris Stelzmüller tuesd4y

View GitHub Profile
@tuesd4y
tuesd4y / HappyNumbers.kt
Last active June 13, 2022 09:02
Calculate all happy numbers from 0 to 100
/**
* What's a happy number? https://en.wikipedia.org/wiki/Happy_number
*
* Simple brute force solution that just evaluates if the happy number sequence reaches one within [MAX_DEPTH] iterations.
*/
object HappyNumbers {
const val MAX_DEPTH = 10_000
@JvmStatic