title: String Containing First Letter Every Word Given String Spaces
signature: fun stringContainingFirstLetterEveryWordGivenStringSpaces(str: String): String {
source_py: def string_containing_first_letter_every_word_given_string_spaces(str):
      result = ''
      v = True
      for i in range(len(str)):
          if (str[i] == ' '):
              v = True
          elif ((str[i] != ' ') and (v == True)):
              result += str[i]
              v = False
      return result
source_cpp: string string_containing_first_letter_every_word_given_string_spaces(string str) {
    string result = "";
    bool v = true;
    for ( int i = 0;
    i < str . length ( );
    i ++ ) {
      if ( str [ i ] == ' ' ) v = true;
      else if ( str [ i ] != ' ' && v == true ) {
        result . push_back ( str [ i ] );
        v = false;
      }
    }
    return result;
  }
question_info.test_list: [{"idx": 0, "outputs": "ta", "inputs": {"str": "t a"}}, {"idx": 1, "outputs": "77267", "inputs": {"str": "77 78 2 600 7"}}, {"idx": 2, "outputs": "011", "inputs": {"str": "011 10 10"}}, {"idx": 3, "outputs": "kCOi", "inputs": {"str": "kV Co O iR"}}, {"idx": 4, "outputs": "2", "inputs": {"str": "2"}}, {"idx": 5, "outputs": "01", "inputs": {"str": "0 11"}}, {"idx": 6, "outputs": "Ysw", "inputs": {"str": "Y sT wgheC"}}, {"idx": 7, "outputs": "586", "inputs": {"str": "58 824 6"}}, {"idx": 8, "outputs": "0100", "inputs": {"str": "00 100 001 0111"}}, {"idx": 9, "outputs": "Q", "inputs": {"str": "Q"}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:String, expected:String):Boolean{
    return actual.equals(expected)
  }
  fun driver(str: String, expected:String):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(str), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver("t a", "ta")
      println("TEST-0...${result}")
      
      result = driver("77 78 2 600 7", "77267")
      println("TEST-1...${result}")
      
      result = driver("011 10 10", "011")
      println("TEST-2...${result}")
      
      result = driver("kV Co O iR", "kCOi")
      println("TEST-3...${result}")
      
      result = driver("2", "2")
      println("TEST-4...${result}")
      
      result = driver("0 11", "01")
      println("TEST-5...${result}")
      
      result = driver("Y sT wgheC", "Ysw")
      println("TEST-6...${result}")
      
      result = driver("58 824 6", "586")
      println("TEST-7...${result}")
      
      result = driver("00 100 001 0111", "0100")
      println("TEST-8...${result}")
      
      result = driver("Q", "Q")
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: stringContainingFirstLetterEveryWordGivenStringSpaces
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn