3 ms·
If you can't write a simple function to reverse a string, or words in a string, in a rather short amount of time, is that a good sign? Sure, everyone can pop ou
by MichaelGG 12y ago
If you can't write a simple function to reverse a string, or words in a string, in a rather short amount of time, is that a good sign? Sure, everyone can pop out the "well the most elegant is use the stdlib's reverse function". But then you say well implement that as efficiently as possible, and we know the end result is a simple little loop -- what should taking more time mean? Someone that takes 10 minutes to come up with the function makes me a bit more nervous than someone that takes 1 minute. Is that wrong?