title: Google Case Given Sentence
signature: string googleCaseGivenSentence(string s) {
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 s, string expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(s), 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("TEYndweqZA", "tEYNDWEQZA"); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver("01865", "01865"); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver("11001100", "11001100"); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver("CzwznJmQet", "cZWZNJMQET"); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver("318305446", "318305446"); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver("0000001111110", "0000001111110"); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver("yzT", "yZT"); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      result = driver("38630230", "38630230"); 
      cout << "TEST-" << 7 << "..."
           <<  result
           << "\n";
  
      result = driver("01101", "01101"); 
      cout << "TEST-" << 8 << "..."
           <<  result
           << "\n";
  
      result = driver("zoizI", "zOIZI"); 
      cout << "TEST-" << 9 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
source_py: def google_case_given_sentence(s):
      n = len(s)
      s1 = ''
      s1 = (s1 + s[0].lower())
      i = 1
      while (i < n):
          if ((s[i] == ' ') and (i <= n)):
              s1 = ((s1 + ' ') + s[(i + 1)].lower())
              i = (i + 1)
          else:
              s1 = (s1 + s[i].upper())
          i = (i + 1)
      return s1
source_cpp: string google_case_given_sentence(string s) {
    int n = s . length ( );
    s [ 0 ] = tolower ( s [ 0 ] );
    for ( int i = 1;
    i < n;
    i ++ ) {
      if ( s [ i ] == ' ' && i < n ) {
        s [ i + 1 ] = tolower ( s [ i + 1 ] );
        i ++;
      }
      else s [ i ] = toupper ( s [ i ] );
    }
    return s;
  }