title: String Containing First Letter Every Word Given String Spaces
signature: string stringContainingFirstLetterEveryWordGivenStringSpaces(string str) {
test_code: #include <algorithm>
  #include <assert.h>
  #include <cstdlib>
  #include <iostream>
  #include <map>
  #include <set>
  #include <string>
  #include <tuple> 
  #include <unordered_map>
  #include <vector>
  #include <math.h>
  #include <cmath>
  #include <bits/stdc++.h>
  #include <numeric>
  #include <functional>
  
  using namespace std;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(string actual, string expected){
      return actual == expected;
  }
  
  string driver(string str, string expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(str), expected)){
              return "PASSED";
          }
          return "FAILED";
      }
      catch (const std::overflow_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::runtime_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::exception& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (...)
      {
          return "UNK_ERROR";
      }
  }
  
  int main() {
      string result = "";
  
      result = driver("t a", "ta"); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver("77 78 2 600 7", "77267"); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver("011 10 10", "011"); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver("kV Co O iR", "kCOi"); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver("2", "2"); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver("0 11", "01"); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver("Y sT wgheC", "Ysw"); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      result = driver("58 824 6", "586"); 
      cout << "TEST-" << 7 << "..."
           <<  result
           << "\n";
  
      result = driver("00 100 001 0111", "0100"); 
      cout << "TEST-" << 8 << "..."
           <<  result
           << "\n";
  
      result = driver("Q", "Q"); 
      cout << "TEST-" << 9 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
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;
  }