Skip to content

reverse words in a string

Problem Statement Write a function that reverse a string. Input string will be given as an array of characters char[]. Can you to it without allocating extra space for another array? Hint: You must do this by modifying the input array in-place with O(1) extra memory. You may assume that all the characters comprise of printable ascii character. Examples: Example 1: Example 2: Let’s see how to solve this question.… Read More »Optimized way to Reverse a String | Leetcode Challenge #344

Optimized way to Reverse a String | Leetcode Challenge #344