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