title: String Containing First Letter Every Word Given String Spaces
signature: function string_containing_first_letter_every_word_given_string_spaces(str)
test_code: 
  
  -- SOLUTION CODE
  -- ============================================
  PLACEHOLDER_CODE_BODY
  
  -- TESTING CODE 
  -- ============================================
  function isCorrect(actual, expected)
      if type(expected) ~= type(actual) then
          return false
      end
      
      if type(expected) == 'table' then
          for k,v_expected in pairs(expected) do
              
              if actual[k] == nil then
                  return false
              end
              local v_actual = actual[k]
              if not isCorrect(v_actual, v_expected) then
                  return false
              end
              actual[k]=nil
          end
      
          if next(actual) then 
              return false
          end
          return true
      else
          return actual == expected
      end
  end
  
  function validateSolution(actual, expected)
      return isCorrect(actual,expected)
  end
  
  function driver(str, expected)
      local exec_result;
      local status, error_msg = pcall(function () 
          exec_result=PLACEHOLDER_FN_NAME(str) 
      end)
      if status then
          if validateSolution(exec_result,expected) then
              return "PASSED"
          end
          return "FAILED"
      else
          return string.format("ERROR=%s",string.gsub(error_msg,".*:[%d]+: ",""))
      end
  end
      
  function main()
      result = driver("t a", "ta")
      print(string.format("TEST-0...%s",result))
  
      result = driver("77 78 2 600 7", "77267")
      print(string.format("TEST-1...%s",result))
  
      result = driver("011 10 10", "011")
      print(string.format("TEST-2...%s",result))
  
      result = driver("kV Co O iR", "kCOi")
      print(string.format("TEST-3...%s",result))
  
      result = driver("2", "2")
      print(string.format("TEST-4...%s",result))
  
      result = driver("0 11", "01")
      print(string.format("TEST-5...%s",result))
  
      result = driver("Y sT wgheC", "Ysw")
      print(string.format("TEST-6...%s",result))
  
      result = driver("58 824 6", "586")
      print(string.format("TEST-7...%s",result))
  
      result = driver("00 100 001 0111", "0100")
      print(string.format("TEST-8...%s",result))
  
      result = driver("Q", "Q")
      print(string.format("TEST-9...%s",result))
  
  end
  
  main()
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;
  }