🌐
LeetCode
leetcode.com › problems › reverse-string
Reverse String - LeetCode
Reverse String - Write a function that reverses a string. The input string is given as an array of characters s. You must do this by modifying the input array in-place [https://en.wikipedia.org/wiki/In-place_algorithm] with O(1) extra memory.
🌐
LeetCode
leetcode.com › problems › reverse-string-ii
Reverse String II - LeetCode
Reverse String II - Given a string s and an integer k, reverse the first k characters for every 2k characters counting from the start of the string. If there are fewer than k characters left, reverse all of them.
🌐
LeetCode
leetcode.com › problems › reverse-words-in-a-string
Reverse Words in a String - LeetCode
Can you solve this real interview question? Reverse Words in a String - Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters.
🌐
LeetCode
leetcode.com › problems › reverse-words-in-a-string-iii
Reverse Words in a String III - LeetCode
Reverse Words in a String III - Given a string s, reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. Example 1: Input: s = "Let's take LeetCode contest" Output: "s'teL ekat ...
🌐
LeetCode
leetcode.com › problems › reverse-vowels-of-a-string
Reverse Vowels of a String - LeetCode
Reverse Vowels of a String - Given a string s, reverse only all the vowels in the string and return it. The vowels are 'a', 'e', 'i', 'o', and 'u', and they can appear in both lower and upper cases, more than once.
🌐
LeetCode
leetcode.com › problems › reverse-only-letters
Reverse Only Letters - LeetCode
Reverse Only Letters - Given a string s, reverse the string according to the following rules: * All the characters that are not English letters remain in the same position. * All the English letters (lowercase or uppercase) should be reversed.
🌐
AlgoMap
algomap.io › problems › reverse-string
Reverse String - Leetcode Solution
Swap the characters at s[l] and s[r]. Increment l and decrement r to move the pointers inward. Show Next Step ... The “Reverse String” problem asks you to reverse a character array s in-place.
🌐
GitHub
github.com › doocs › leetcode › blob › main › solution › 0300-0399 › 0344.Reverse String › README_EN.md
leetcode/solution/0300-0399/0344.Reverse String/README_EN.md at main · doocs/leetcode
impl Solution { pub fn reverse_string(s: &mut Vec<char>) { let mut i = 0; let mut j = s.len() - 1; while i < j { s.swap(i, j); i += 1; j -= 1; } } }
Author   doocs
🌐
Medium
evan-soohoo.medium.com › repeat-code-with-leetcode-reverse-words-in-a-string-e6d4cf399682
Repeat Code With LeetCode — Reverse Words In A String | by Evan ...
May 9, 2024 - The other idea is a lot more clever…it was taken from him, who in turn referenced this blog post. Arden writes: Reverse all the characters in the string, then reverse the letters of each individual word.
Find elsewhere
🌐
WalkCCC
walkccc.me › LeetCode › problems › 344
344. Reverse String - LeetCode Solutions
LeetCode Solutions in C++23, Java, Python, MySQL, and TypeScript.
🌐
AlgoMonster
algo.monster › liteproblems › 344
344. Reverse String - In-Depth Explanation
In-depth solution and explanation for LeetCode 344. Reverse String in Python, Java, C++ and more. Intuitions, example walk through, and complexity analysis. Better than official and forum solutions.
🌐
LeetCode
leetcode.com › problems › reverse-words-in-a-string-ii
Reverse Words in a String II - LeetCode
Can you solve this real interview question? Reverse Words in a String II - Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview.
🌐
LeetCode
leetcode.com › problems › reverse-degree-of-a-string
Reverse Degree of a String - LeetCode
The reverse degree is calculated as follows: 1. For each character, multiply its position in the reversed alphabet ('a' = 26, 'b' = 25, ..., 'z' = 1) with its position in the string (1-indexed).
🌐
Devsenv
devsenv.com › example › -344-leetcode-reverse-string-solution-in-c,-c++,-java,-javascript,-python,-c-leetcode
#344 Leetcode Reverse String Solution in C, C++, Java, JavaScript, Python, C# Leetcode
January 16, 2023 - char* reverseString(char* s) { int i = 0; int j; char c; if (!s) return s; j = strlen(s); if (j < 2) return s; j --; while (i < j) { c = s[j]; s[j] = s[i]; s[i] = c; i ++; j --; } return s; } Copy The Code & Try With Live Editor ... class Solution { public: string reverseString(string s) { ...
🌐
GitHub
github.com › doocs › leetcode › blob › main › solution › 0100-0199 › 0151.Reverse Words in a String › README_EN.md
leetcode/solution/0100-0199/0151.Reverse Words in a String/README_EN.md at main · doocs/leetcode
Given an input string s, reverse the order of the words. A word is defined as a sequence of non-space characters. The words in s will be separated by at least one space. Return a string of the words in reverse order concatenated by a single space.
Author   doocs
🌐
Medium
lydiaplu.medium.com › leetcode-541-reverse-string-ii-24a879b40fdd
LeetCode — 541. Reverse String II | by Pan Lu | Medium
January 31, 2024 - Reversing Characters: The characters between left and right are then reversed using a while loop and a temporary variable for swapping. Returning the Result: After all segments are processed, the character array is returned to a string.
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › reverse-a-string
Reverse a String – Complete Tutorial - GeeksforGeeks
After each swap, increment the left pointer and decrement the right pointer to move towards the center of the string. This will swap all the characters in the first half with their corresponding character in the second half.
Published   October 3, 2025