Feb-13-2017, 08:52 PM
Yeah, isdigit() is a lot of people's first thought, and it's not very inclusive. What you have that works, for such a simple question we disallow using a tool that basically does the task directly.
I prefer to give questions that don't prohibit using anything, that (hopefully) can't be Google'd too easily, but this is the closest I get to "dead simple". sqrt() (using binary search) is another simple-ish one.
I prefer to give questions that don't prohibit using anything, that (hopefully) can't be Google'd too easily, but this is the closest I get to "dead simple". sqrt() (using binary search) is another simple-ish one.