Given a list of characters chars, reverse the characters in place and return the modified list. The goal is to solve it without allocating another full-size array for the result.
Example 1:
Input: chars = ["h", "e", "l", "l", "o"]
Output: ["o", "l", "l", "e", "h"]
Explanation: Swapping characters from both ends reverses the array.
Example 2:
Input: chars = ["H", "a", "n", "n", "a", "h"]
Output: ["h", "a", "n", "n", "a", "H"]
Explanation: The first and last characters are swapped, then the process continues inward.
1 <= len(chars) <= 10^5chars[i] is a single printable characterO(1) extra space for the main solution