原文:[LeetCode] 344. Reverse String 翻轉字符串

Write a function that reverses a string. The input string is given as an array of characterschar . Do not allocate extra space for another array, you must do this bymodifying the input arrayin placew ...

2016-04-22 12:38 6 11054 推薦指數:

查看詳情

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 ...

Sat May 25 05:34:00 CST 2019 0 746
python(leetcode)-344反轉字符串

編寫一個函數,其作用是將輸入的字符串反轉過來。輸入字符串字符數組 char[] 的形式給出。 不要給另外的數組分配額外的空間,你必須原地修改輸入數組、使用 O(1) 的額外空間解決這一問題。 你可以假設數組中的所有字符都是 ASCII 碼表中的可打印字符。 示例 1: 輸入:["h ...

Wed Feb 20 19:49:00 CST 2019 0 564
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM