Given an array of characters chars, reverse the array in place and return it. The reversed result must contain the same characters in opposite order, and the solution should use constant extra space aside from the input array.
def reverse_string(chars):