title: Print Words String Reverse Order
signature: printWordsStringReverseOrder :: String -> String
  printWordsStringReverseOrder str = 
test_code: import Text.Printf
  import Control.Exception (catch, SomeException)
  import Data.Typeable
  import qualified Data.List as List
  import qualified Data.Map as Map
  import qualified Data.Set as Set
  
  -- SOLUTION CODE
  -- ============================================
  
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  validateSolution :: String -> String -> Bool
  validateSolution actual expected = do
      actual == expected
  
  
  driver :: String -> String -> String
  driver str expected = do
      if (validateSolution (PLACEHOLDER_FN_NAME str) expected)
          then "PASSED"
      else "FAILED"
  
  main = do
      printf "TEST-0...%s\n" (driver ("m Dm YZ") ("YZ Dm m") )
  
      printf "TEST-1...%s\n" (driver ("65 48 57 71") ("71 57 48 65") )
  
      printf "TEST-2...%s\n" (driver ("01 010") ("010 01") )
  
      printf "TEST-3...%s\n" (driver ("mT vhByi") ("vhByi mT") )
  
      printf "TEST-4...%s\n" (driver ("19 44 9 1") ("1 9 44 19") )
  
      printf "TEST-5...%s\n" (driver ("0") ("0") )
  
      printf "TEST-6...%s\n" (driver ("z vUi  ") ("  vUi z") )
  
      printf "TEST-7...%s\n" (driver ("7 591 36643 9 055") ("055 9 36643 591 7") )
  
      printf "TEST-8...%s\n" (driver ("01") ("01") )
  
      printf "TEST-9...%s\n" (driver ("ti YGaijPY") ("YGaijPY ti") )
  
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;
  }