title: Print Words String Reverse Order
signature: def printWordsStringReverseOrder(str: String) = {
test_code: import scala.collection.mutable.HashMap
  import scala.collection.immutable.HashSet
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  
  // TESTING CODE 
  // ============================================
  def validateSolution(actual: String , expected: String): Boolean = {
      actual.toString == expected.toString
  }
  
  def driver(str: String, expected: String): String = {
      try {
          if (validateSolution(PLACEHOLDER_FN_NAME(str),expected)) {
              "PASSED"
          } else{
              "FAILED"
          }
      }catch{
          case e: Exception => {e.getClass.getName}
      }
  
  }
  object QuestionEvaluator extends App {
  
      println(s"TEST-0...${driver(
        "m Dm YZ", 
        "YZ Dm m"    
      )}")   
  
  
      println(s"TEST-1...${driver(
        "65 48 57 71", 
        "71 57 48 65"    
      )}")   
  
  
      println(s"TEST-2...${driver(
        "01 010", 
        "010 01"    
      )}")   
  
  
      println(s"TEST-3...${driver(
        "mT vhByi", 
        "vhByi mT"    
      )}")   
  
  
      println(s"TEST-4...${driver(
        "19 44 9 1", 
        "1 9 44 19"    
      )}")   
  
  
      println(s"TEST-5...${driver(
        "0", 
        "0"    
      )}")   
  
  
      println(s"TEST-6...${driver(
        "z vUi  ", 
        "  vUi z"    
      )}")   
  
  
      println(s"TEST-7...${driver(
        "7 591 36643 9 055", 
        "055 9 36643 591 7"    
      )}")   
  
  
      println(s"TEST-8...${driver(
        "01", 
        "01"    
      )}")   
  
  
      println(s"TEST-9...${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;
  }