title: Print Words String Reverse Order
signature: printWordsStringReverseOrder(str) {
test_code: import 'dart:convert';
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(String actual, String expected){
      return actual.toString() == expected.toString();
  }
  
  String driver(str, String expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(str), expected)){
              return "PASSED";
          }
          return "FAILED";
      }catch(exception_object){
          return exception_object.runtimeType.toString();
      }
  }
  
  int main() {
  
      print("TEST-0...${driver(
          "m Dm YZ", 
          "YZ Dm m")
      }");
  
      print("TEST-1...${driver(
          "65 48 57 71", 
          "71 57 48 65")
      }");
  
      print("TEST-2...${driver(
          "01 010", 
          "010 01")
      }");
  
      print("TEST-3...${driver(
          "mT vhByi", 
          "vhByi mT")
      }");
  
      print("TEST-4...${driver(
          "19 44 9 1", 
          "1 9 44 19")
      }");
  
      print("TEST-5...${driver(
          "0", 
          "0")
      }");
  
      print("TEST-6...${driver(
          "z vUi  ", 
          "  vUi z")
      }");
  
      print("TEST-7...${driver(
          "7 591 36643 9 055", 
          "055 9 36643 591 7")
      }");
  
      print("TEST-8...${driver(
          "01", 
          "01")
      }");
  
      print("TEST-9...${driver(
          "ti YGaijPY", 
          "YGaijPY ti")
      }");
  
      return 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;
  }