原文:[LeetCode] Reverse String II 翻转字符串之二

Given a string and an integer k, you need to reverse the first k characters for every k characters counting from the start of the string. If there are less than k characters left, reverse all of them ...

2017-03-19 23:22 0 6697 推荐指数:

查看详情

[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
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
 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM