title: String Containing First Letter Every Word Given String Spaces
signature: function stringContainingFirstLetterEveryWordGivenStringSpaces(str: string): string {
test_code: 
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  function convertToString(value: any): string{
      return JSON.stringify(value, function (key, val) {
          if (val instanceof Set) {
              return Array.from(val);
          } return val;});
  }
  
  function validateSolution(actual: string, expected: string): boolean {
      return convertToString(actual) === convertToString(expected);
  }
  
  function driver(str: string, expected:string): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(str),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver("t a", "ta");
    console.log(`TEST-0...${result}`);
  
    result = driver("77 78 2 600 7", "77267");
    console.log(`TEST-1...${result}`);
  
    result = driver("011 10 10", "011");
    console.log(`TEST-2...${result}`);
  
    result = driver("kV Co O iR", "kCOi");
    console.log(`TEST-3...${result}`);
  
    result = driver("2", "2");
    console.log(`TEST-4...${result}`);
  
    result = driver("0 11", "01");
    console.log(`TEST-5...${result}`);
  
    result = driver("Y sT wgheC", "Ysw");
    console.log(`TEST-6...${result}`);
  
    result = driver("58 824 6", "586");
    console.log(`TEST-7...${result}`);
  
    result = driver("00 100 001 0111", "0100");
    console.log(`TEST-8...${result}`);
  
    result = driver("Q", "Q");
    console.log(`TEST-9...${result}`);
  
  };
  
  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;
  }