技术随感
搜索此博客
2011年2月26日星期六
Reverse words in sentence while keeping position of white space
Input: “I am a student."
Output: “student. a am I"
Time: O(n).
Solution: At the first step, reverse the whole sentence, then reverse the word one by one.
没有评论:
发表评论
较新的博文
较早的博文
主页
订阅:
博文评论 (Atom)
没有评论:
发表评论