Programming Interview Questions 12: Reverse Words in a String | Arden DertatArden Dertat
This is probably by far the most common string manipulation interview question. Given an input string, reverse all the words. To clarify, input: "Interviews are awesome!" output: "awesome! are Interviews". Consider all consecutive non-whitespace characters as individual words. If there are multiple spaces between words reduce them to a single white space. Also remove all leading and trailing whitespaces. So, the output for " CS degree", "CS degree", "CS degree ", or " CS degree " are all the same: "degree CS".
Read full article from Programming Interview Questions 12: Reverse Words in a String | Arden DertatArden Dertat
No comments:
Post a Comment