Write a string manipulation algorithm that optimizes memory usage and avoids unnecessary allocations.
Implement reverse_words(chars) for a mutable list of single-character strings. Reverse the order of words in place, normalize whitespace to exactly one space between words, and remove leading or trailing whitespace. Return the same list object after modification. A word is a maximal sequence of non-whitespace characters. Do not use split, join, slicing, or a second character array.
chars is a mutable list of characters. Modify it in place and return it.
def reverse_words(chars):