Ad
  • Custom User Avatar

    I can answer that. If an input string ends with a letter, last word won't be added to the result. So here we appending random char to str and popping it back at the end.

  • Custom User Avatar

    Really cool solution! I should note to everyone here ellipsis in cases is non-standard, but clang and gcc supports them and it really should be in the standard.