Hacker News new | past | comments | ask | show | jobs | submit login

I like the manual solution better: it includes thought process without negative impact on readability or performance.

This makes it easier to match the code against the specification, something a random (and in this case even wrong) magic number fails to do.

But maybe I'm overthinking it.




You're not overthinking it.

You're correct.




Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: