input: from typing import List, Union
  
  def reverse_words(string: Union[str, List[str]]) -> str:
      """ Reverse the order of words in a sentence while keeping the order of the characters in each word unchanged.
      >>> reverse_words("This is a sentence.")
      'sentence. a is This'
      >>> reverse_words("Hello world")
      'world Hello'
      """
output:     if isinstance(string, list):
          string = ' '.join(string)
      words = string.split()
      reversed_words = words[::-1]
      return ' '.join(reversed_words)