I have run this exercise with multiple C++ developers from junior to senior. Its a simple task that can reveal strength/weakness in a devs understanding of what good C++ could look like.
Implement a reverse words function that works in-place on the string provided.
- Make it correct
- Make it performant
- Make it maintainable
Give it a go. I'll also post content warning hint(s) as replies.
@glloyd This is a rotate and I claim my five pounds!
@jezhiggins @glloyd
Funny, but with the space, that's just more complicated. Also, the rotate is O(n*m) performance, not O(n)