Hacker News new | ask | show | jobs
by hechang1997 2418 days ago
I don't know about this. This feels like cheating rather than thinking outside of the box. Like when you ask a student to implement a vector in C++, instead of writing the code the student makes a wrapper around std::vector. Internally, `str` probably also use some equivalent of the naive solution implemented somewhere to convert a integer to its decimal string.
1 comments

Using math.log10 seems at least as cheating to me. (though to be clear, I'd accept both if it were me)