原文:[LeetCode] 186. Reverse Words in a String II 翻转字符串中的单词之二

Given an input string, reverse the string word by word. Example: Note: A word is defined as a sequence of non space characters. The input string does not contain leading or trailing spaces. The words ...

2016-02-11 07:48 3 10899 推荐指数:

查看详情

Leetcode: Reverse Words in a String II

这道题要求in-place做法,不能使用extra space, 那么,做法跟Rotate Array那道题非常相似 (1)reverse the whole array (2)reverse each subarray seperated by ' ' 注意不要忘了 ...

Sun Mar 01 15:49:00 CST 2015 0 6069
[LeetCode] 344. Reverse String 翻转字符串

Write a function that reverses a string. The input string is given as an array of characters char[]. Do not allocate extra space for another ...

Fri Apr 22 20:38:00 CST 2016 6 11054
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM