Source: leetcode 344. Reverse String
Q. Write a function that takes a string as input and returns the string reversed.
Example:
Given s = “hello”, return “olleh”
Answer 1: Using two pointers
Answer 2: Using simple string concatenation
Source: leetcode 344. Reverse String
Q. Write a function that takes a string as input and returns the string reversed.
Example:
Given s = “hello”, return “olleh”
Answer 1: Using two pointers
Answer 2: Using simple string concatenation