title: Google Case Given Sentence
signature: fun googleCaseGivenSentence(s: String): String {
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;
  }
question_info.test_list: [{"idx": 0, "outputs": "tEYNDWEQZA", "inputs": {"s": "TEYndweqZA"}}, {"idx": 1, "outputs": "01865", "inputs": {"s": "01865"}}, {"idx": 2, "outputs": "11001100", "inputs": {"s": "11001100"}}, {"idx": 3, "outputs": "cZWZNJMQET", "inputs": {"s": "CzwznJmQet"}}, {"idx": 4, "outputs": "318305446", "inputs": {"s": "318305446"}}, {"idx": 5, "outputs": "0000001111110", "inputs": {"s": "0000001111110"}}, {"idx": 6, "outputs": "yZT", "inputs": {"s": "yzT"}}, {"idx": 7, "outputs": "38630230", "inputs": {"s": "38630230"}}, {"idx": 8, "outputs": "01101", "inputs": {"s": "01101"}}, {"idx": 9, "outputs": "zOIZI", "inputs": {"s": "zoizI"}}]
question_info.extension: kts
question_info.test_code: package main
  
  import kotlin.text.*
  import kotlin.math.*
  
  
  // SOLUTION CODE
  // ===================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE
  // ===================================
  fun validateSolution(actual:String, expected:String):Boolean{
    return actual.equals(expected)
  }
  fun driver(s: String, expected:String):String {
      try{
        if (validateSolution(PLACEHOLDER_FN_NAME(s), expected)) {
                return "PASSED"
        }
        return "FAILED"
      } catch (e: Exception){
        return e::class.simpleName as String
      }
  
  }
  
  fun main() {
      var result: String = ""
      result = driver("TEYndweqZA", "tEYNDWEQZA")
      println("TEST-0...${result}")
      
      result = driver("01865", "01865")
      println("TEST-1...${result}")
      
      result = driver("11001100", "11001100")
      println("TEST-2...${result}")
      
      result = driver("CzwznJmQet", "cZWZNJMQET")
      println("TEST-3...${result}")
      
      result = driver("318305446", "318305446")
      println("TEST-4...${result}")
      
      result = driver("0000001111110", "0000001111110")
      println("TEST-5...${result}")
      
      result = driver("yzT", "yZT")
      println("TEST-6...${result}")
      
      result = driver("38630230", "38630230")
      println("TEST-7...${result}")
      
      result = driver("01101", "01101")
      println("TEST-8...${result}")
      
      result = driver("zoizI", "zOIZI")
      println("TEST-9...${result}")
      
          
  }
  
  main()
question_info.entry_fn_name: googleCaseGivenSentence
question_info.entry_cls_name: Solution
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: kotlinc -script __FILENAME__ -no-reflect -nowarn