title: Print Words String Reverse Order
signature: print_words_string_reverse_order <- function(str) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(str, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(str), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          "m Dm YZ", 
          "YZ Dm m"
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          "65 48 57 71", 
          "71 57 48 65"
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          "01 010", 
          "010 01"
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          "mT vhByi", 
          "vhByi mT"
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          "19 44 9 1", 
          "1 9 44 19"
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          "0", 
          "0"
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          "z vUi  ", 
          "  vUi z"
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          "7 591 36643 9 055", 
          "055 9 36643 591 7"
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          "01", 
          "01"
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          "ti YGaijPY", 
          "YGaijPY ti"
      )))
  
  }
  
  main()
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;
  }