344. Reverse String--LeetCode Record
Write a function that takes a string as input and returns the string
reversed.Example: Given s = “hello”, return “olleh”.
class Solution {
func reverseString(s: String) -> String {
var strRev:String = ""
var charts:[Character] = []
for chart in s.characters {
charts.append(chart)
}
for chart in charts.reverse() {
strRev.append(chart)
}
return String(strRev)
}
}
相關文章
- leetcode 344. Reverse StringLeetCode
- [LeetCode-Easy]344. Reverse String-逆置字串LeetCode字串
- 206. Reverse Linked List--LeetCode RecordLeetCode
- REVERSE關鍵字之REVERSE函式函式
- JavaScript reverse()JavaScript
- Reverse Key IndexesIndex
- BUUCTF reverse 3
- react-recordReact
- javascript 陣列 reverse()JavaScript陣列
- oracle reverse函式Oracle函式
- Reverse Card (Hard Version)
- hackme 【攻防世界】Reverse
- Daily record-SeptemberAI
- Simple python reverse shellPython
- leetcode Reverse IntegerLeetCode
- Why would a reverse index be useful ?Index
- Reverse Key Indexes (219)Index
- Reverse學習筆記筆記
- 實戰 Java 16 值型別 Record - 2. Record 的基本用法Java型別
- pl/sql record 詳解SQL
- delete duplication record in sql serverdeleteSQLServer
- Leetcode 7 Reverse IntegerLeetCode
- LeetCode-Reverse BitsLeetCode
- js String新增 reverse()方法JS
- js reverse()函式的作用JS函式
- 4. render, redirect, HttpResponse, reverseHTTP
- Reverse Integer leetcode javaLeetCodeJava
- Java 16 新特性:record類Java
- Erlang中的Record詳解
- 淺析 record 使用場景
- Record It for Mac錄屏軟體Mac
- Java 21 新特性:Record PatternsJava
- 脫離rails 使用Active RecordAI
- Homework record-Simple sorting
- gorm忽略報錯: record not foundGoORM
- 精讀《ObjectEntries, Shift, Reverse...》Object
- Leetcode-Problem:Reverse IntegerLeetCode
- 反向代理伺服器(Reverse Proxy)伺服器