🌐
LeetCode
leetcode.com › problems › valid-palindrome
Valid Palindrome - LeetCode
Valid Palindrome - A phrase is a palindrome if, after converting all uppercase letters into lowercase letters and removing all non-alphanumeric characters, it reads the same forward and backward.
🌐
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.
Discussions

java - 344. Reverse String LeetCode - Stack Overflow
I've got this code that runs in my IDE, Intellij but it will not run in LeetCode. Am I misunderstanding the question? Write a function that reverses a string. The input string is given as an array... More on stackoverflow.com
🌐 stackoverflow.com
Reverse words in a string using multithreading?
UPDATE: Since the question was clarified. I'll have to change my answer slightly. Input: "The cat is a dog" Output: "dog a is cat The" One trick to solve this problem is to reverse the entire string once and then reverse the words. So something like this: "The cat is a dog" => "god a si tac ehT" => "dog a is cat The" So you could parallelize the first step. That would require you to choose smaller chunks of ranges within the larger range of 0 to n/2 And then you could parallelize the second step, but only after the first step is completely done. And the second step would look like what I was describing earlier: A helper function called reverseWords(str, start int, end int) This would allow you to process the str chunk by chunk independently on different threads. You would just need to ensure that the cut off points only land on spaces (so as not to cut a word in half). Then, it just becomes a two pointer problem, or you could use a stack if you prefer. More on reddit.com
🌐 r/leetcode
12
4
April 23, 2024
Today's daily challenge "Reverse words in a string" - Python Solution
return " ".join(filter(lambda x:len(x)!=0,s.split(" ")[::-1])) More on reddit.com
🌐 r/leetcode
29
6
November 13, 2022
issue in mu code in --> 151. Reverse Words in a String
For the last word 'blue' it adds all letters by using 'if' condition but when 'i' becomes 'n-1' it still executes 'if' condition and 'else' is not executed,hence the last word doesn't get pushed into the stack . You will have to add another check at last that if word.length!=0 then push word. More on reddit.com
🌐 r/leetcode
2
0
February 26, 2022
🌐
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   5 days ago
🌐
Stack Overflow
stackoverflow.com › questions › 66214162 › 344-reverse-string-leetcode
java - 344. Reverse String LeetCode - Stack Overflow
The input string is given as an array of characters char[]. Do not allocate extra space for another array, you must do this by modifying the input array in-place with O(1) extra memory. You may assume all the characters consist of printable ascii characters. class Solution { public void reverseString(char[] s) { int arrayLength = s.length - 1; System.out.print("["); for (int i = 0; i < s.length; i++) { int temp = s.length - i - 1; if (i != arrayLength) { System.out.printf("\"%s\",", s[temp]); } else { System.out.printf("\"%s\"", s[temp]); } } System.out.print("]"); }
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › reverse-a-linked-list
Reverse a Linked List - GeeksforGeeks
At each step, point the current node to its previous node and then move all three pointers forward until the list is fully reversed.
Published   5 days ago
🌐
LeetCode
leetcode.com › problem-list › stack
Stack - LeetCode
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.
🌐
Medium
valentinplacido25.medium.com › leetcode-344-reverse-string-javascript-basics-b390f64d05b8
LeetCode 344. Reverse String — JavaScript Basics - Valentin Placido - Medium
October 18, 2020 - You may assume all the characters consist of printable ascii characters. ... var reverseString = function(s) { for (let i = 0; i < s.length/2; i++) { let n = s[i] s[i] = s[s.length-i-1] s[s.length-i-1] = n } };
Find elsewhere
🌐
Pcoroneos
pcoroneos.com › blog › leetcode › 344-reverse-string
Leetcode 344 - Reverse String - Paul Coroneos
May 3, 2025 - Write a function that reverses a string. The input string is given as an array of characters s.
🌐
LeetCode
leetcode.com › problems › rotate-array
Rotate Array - LeetCode
Can you solve this real interview question? Rotate Array - Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate ...
🌐
LeetCode
leetcode.com › problems › rotate-string
Rotate String - LeetCode
Rotate String - Given two strings s and goal, return true if and only if s can become goal after some number of shifts on s. A shift on s consists of moving the leftmost character of s to the rightmost position.
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › top-50-string-coding-problems-for-interviews
String Coding Interview Questions - GeeksforGeeks
September 18, 2025 - Reverse Words · Check for Rotation · First Non Repeating · Roman to Integer · Implement Atoi · Encrypt the String – II · Equal Point in Brackets · Anagram Checking · Panagram Checking · Validate IP Address · Add Binary Strings · Integer to Words ·
🌐
AlgoExpert
algoexpert.io › questions
AlgoExpert | Ace the Coding Interviews
The leading platform to prepare for coding interviews. Master essential algorithms and data structures, and land your dream job with AlgoExpert.
🌐
Sean Prashad
seanprashad.com › leetcode-patterns
Leetcode Patterns
A curated list of leetcode questions grouped by their common patterns
🌐
LeetCode
leetcode.com › problems › valid-anagram
Valid Anagram - LeetCode
Valid Anagram - Given two strings s and t, return true if t is an anagram of s, and false otherwise. Example 1: Input: s = "anagram", t = "nagaram" Output: true Example 2: Input: s = "rat", t = "car" Output: false Constraints: * 1
🌐
GeeksforGeeks
geeksforgeeks.org › dsa › dsa-sheet-by-love-babbar
DSA Sheet by Love Babbar - GeeksforGeeks
August 25, 2025 - Your All-in-One Learning Portal. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
🌐
LeetCode
leetcode.com › problems › validate-binary-search-tree
Validate Binary Search Tree - LeetCode
Can you solve this real interview question? Validate Binary Search Tree - Given the root of a binary tree, determine if it is a valid binary search tree (BST). A valid BST is defined as follows: * The left subtree of a node contains only nodes with keys strictly less than the node's key.
🌐
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
/** Do not return anything, modify s in-place instead. */ function reverseString(s: string[]): void { for (let i = 0, j = s.length - 1; i < j; ++i, --j) { [s[i], s[j]] = [s[j], s[i]]; } }
Author   doocs