title: Google Case Given Sentence
signature: function googleCaseGivenSentence(s: 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(s: string, expected:string): string {
      try{
          if (validateSolution(PLACEHOLDER_FN_NAME(s),expected)){
              return "PASSED";
          }
          return "FAILED";
      } catch (error) {
        return error.name;
      }
      
  }
      
  function main(){
    let result = '';
    result = driver("TEYndweqZA", "tEYNDWEQZA");
    console.log(`TEST-0...${result}`);
  
    result = driver("01865", "01865");
    console.log(`TEST-1...${result}`);
  
    result = driver("11001100", "11001100");
    console.log(`TEST-2...${result}`);
  
    result = driver("CzwznJmQet", "cZWZNJMQET");
    console.log(`TEST-3...${result}`);
  
    result = driver("318305446", "318305446");
    console.log(`TEST-4...${result}`);
  
    result = driver("0000001111110", "0000001111110");
    console.log(`TEST-5...${result}`);
  
    result = driver("yzT", "yZT");
    console.log(`TEST-6...${result}`);
  
    result = driver("38630230", "38630230");
    console.log(`TEST-7...${result}`);
  
    result = driver("01101", "01101");
    console.log(`TEST-8...${result}`);
  
    result = driver("zoizI", "zOIZI");
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
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;
  }