title: String Containing First Letter Every Word Given String Spaces
signature: string_containing_first_letter_every_word_given_string_spaces <- function(str) {
test_code: 
  
  
  # SOLUTION CODE
  # ============================================
  PLACEHOLDER_CODE_BODY
  
  # TESTING CODE 
  # ============================================
  validate_solution <- function(actual, expected) {
      toString(actual)==toString(expected)
  }
  
  driver <- function(str, expected){
      if (validate_solution(PLACEHOLDER_FN_NAME(str), expected)){
          "PASSED"
      } else{
          "FAILED"
      }
  }
  
  main <- function() {
      cat(sprintf("TEST-0...%s\n",driver(
          "t a", 
          "ta"
      )))
  
      cat(sprintf("TEST-1...%s\n",driver(
          "77 78 2 600 7", 
          "77267"
      )))
  
      cat(sprintf("TEST-2...%s\n",driver(
          "011 10 10", 
          "011"
      )))
  
      cat(sprintf("TEST-3...%s\n",driver(
          "kV Co O iR", 
          "kCOi"
      )))
  
      cat(sprintf("TEST-4...%s\n",driver(
          "2", 
          "2"
      )))
  
      cat(sprintf("TEST-5...%s\n",driver(
          "0 11", 
          "01"
      )))
  
      cat(sprintf("TEST-6...%s\n",driver(
          "Y sT wgheC", 
          "Ysw"
      )))
  
      cat(sprintf("TEST-7...%s\n",driver(
          "58 824 6", 
          "586"
      )))
  
      cat(sprintf("TEST-8...%s\n",driver(
          "00 100 001 0111", 
          "0100"
      )))
  
      cat(sprintf("TEST-9...%s\n",driver(
          "Q", 
          "Q"
      )))
  
  }
  
  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;
  }