原文:[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