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.
Videos
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
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
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
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
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
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("]"); }
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.
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.
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
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
LinkedIn
linkedin.com โบ posts โบ japneet-sachdeva_japneetsachdeva-activity-7354493306350825473-IL-O
How to move negative numbers in an array with algorithmic ...
We cannot provide a description for this page right now
LeetCode
leetcode.com โบ problems โบ binary-search
Binary Search - LeetCode
Can you solve this real interview question? Binary Search - Given an array of integers nums which is sorted in ascending order, and an integer target, write a function to search target in nums. If target exists, then return its index. Otherwise, return -1. You must write an algorithm with O(log ...