# 02.06.2024 [344. Reverse String]
Reverse an array #easy
02.06.2024
344. Reverse String easy
blog post
Join me on Telegram
https://t.me/leetcode_daily_unstoppable/626
Problem TLDR
Reverse an array #easy
Intuition
We can use two pointers or just a single for-loop until the middle.
Approach
Careful with the corner case: exclude the middle for the even size
try to use built-in functions
Complexity
Time complexity:
𝑂(𝑛)Space complexity:
𝑂(1)
Code
fun reverseString(s: CharArray) = s.reverse()
pub fn reverse_string(s: &mut Vec<char>) {
s.reverse()
}

