Write a function that takes a string as input and returns the string reversed.
Given s = “hello”, return “olleh”.
- Convert string to array of letters
- The goal is to swap each letter with it’s opposite one.
- Half of the length is the times we need to swap. If it’s an odd length array, then round to the smaller side.
- Use a while loop to swap letters
- Join the reversed array back into a string and return