title: Google Case Given Sentence
signature: func googleCaseGivenSentence(s string) string {
test_code: package main
  
  import (
      "fmt"
      "reflect"
      "math"
      "sort"
  )
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  func validateSolution(actual string, expected string) bool {
      return reflect.DeepEqual(actual,expected)
  }
  
  func driver(s string, expected string) string {
      if validateSolution(PLACEHOLDER_FN_NAME(s),expected) {
              return "PASSED"
      }
      return "FAILED"
  
  }
  
  func main() {
  
      // Use imports to avoid undefined errors
      var _ = reflect.DeepEqual
      _ = math.Abs
      _ = sort.Sort
      result := ""
      result = driver("TEYndweqZA", "tEYNDWEQZA")
      fmt.Printf("TEST-0...%s\n", result)
      
      result = driver("01865", "01865")
      fmt.Printf("TEST-1...%s\n", result)
      
      result = driver("11001100", "11001100")
      fmt.Printf("TEST-2...%s\n", result)
      
      result = driver("CzwznJmQet", "cZWZNJMQET")
      fmt.Printf("TEST-3...%s\n", result)
      
      result = driver("318305446", "318305446")
      fmt.Printf("TEST-4...%s\n", result)
      
      result = driver("0000001111110", "0000001111110")
      fmt.Printf("TEST-5...%s\n", result)
      
      result = driver("yzT", "yZT")
      fmt.Printf("TEST-6...%s\n", result)
      
      result = driver("38630230", "38630230")
      fmt.Printf("TEST-7...%s\n", result)
      
      result = driver("01101", "01101")
      fmt.Printf("TEST-8...%s\n", result)
      
      result = driver("zoizI", "zOIZI")
      fmt.Printf("TEST-9...%s\n", result)
      
          
  }
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;
  }