title: Print Words String Reverse Order
signature: def print_words_string_reverse_order(str):
test_code: import array
  import bisect
  import collections
  import datetime
  import functools
  import heapq
  import itertools
  import math
  import queue
  import re
  import string
  import sys
  from typing import Any, Dict, List, Optional, Set
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  def validate_solution(actual, expected):
      return actual == expected
  
  def driver(str, expected):
      try:
          if validate_solution(PLACEHOLDER_FN_NAME(
              str),
              expected
          ):
              return "PASSED"
          return "FAILED"
      except Exception as exception_obj:
          return type(exception_obj).__name__
      
  if __name__ == "__main__":
      result = driver("m Dm YZ", "YZ Dm m")
      print(f"TEST-0...{result}")
  
      result = driver("65 48 57 71", "71 57 48 65")
      print(f"TEST-1...{result}")
  
      result = driver("01 010", "010 01")
      print(f"TEST-2...{result}")
  
      result = driver("mT vhByi", "vhByi mT")
      print(f"TEST-3...{result}")
  
      result = driver("19 44 9 1", "1 9 44 19")
      print(f"TEST-4...{result}")
  
      result = driver("0", "0")
      print(f"TEST-5...{result}")
  
      result = driver("z vUi  ", "  vUi z")
      print(f"TEST-6...{result}")
  
      result = driver("7 591 36643 9 055", "055 9 36643 591 7")
      print(f"TEST-7...{result}")
  
      result = driver("01", "01")
      print(f"TEST-8...{result}")
  
      result = driver("ti YGaijPY", "YGaijPY ti")
      print(f"TEST-9...{result}")
  
      sys.exit(0)
source_py: def print_words_string_reverse_order(str):
      i = (len(str) - 1)
      start = end = (i + 1)
      result = ''
      while (i >= 0):
          if (str[i] == ' '):
              start = (i + 1)
              while (start != end):
                  result += str[start]
                  start += 1
              result += ' '
              end = i
          i -= 1
      start = 0
      while (start != end):
          result += str[start]
          start += 1
      return result
source_cpp: string print_words_string_reverse_order(string str) {
    int i = str . length ( ) - 1;
    int start, end = i + 1;
    string result = "";
    while ( i >= 0 ) {
      if ( str [ i ] == ' ' ) {
        start = i + 1;
        while ( start != end ) result += str [ start ++ ];
        result += ' ';
        end = i;
      }
      i --;
    }
    start = 0;
    while ( start != end ) result += str [ start ++ ];
    return result;
  }