title: Google Case Given Sentence
signature: class Solution {
  
      public String googleCaseGivenSentence(String s) {
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.extension: java
question_info.entry_fn_name: googleCaseGivenSentence
question_info.entry_cls_name: Solution
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.test_code: import static java.util.Map.entry;  
  import java.util.*;
  import java.lang.*;
  // TESTING CODE 
  // ============================================
  class QuestionEvaluator {
      public static String validateSolution(String s, String expected){
          try{
              Driver driver = new Driver();
              if (driver.run(s,expected)){
                  return "PASSED";
              }
              return "FAILED";
              
          } catch (Exception exception_obj){
              return exception_obj.getClass().getSimpleName();
          }
  
      }
      public static void main(String[] args) {
          String result;
          result = validateSolution("TEYndweqZA", "tEYNDWEQZA");
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution("01865", "01865");
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution("11001100", "11001100");
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution("CzwznJmQet", "cZWZNJMQET");
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution("318305446", "318305446");
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution("0000001111110", "0000001111110");
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution("yzT", "yZT");
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution("38630230", "38630230");
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution("01101", "01101");
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution("zoizI", "zOIZI");
          System.out.println(String.format("%s%s","TEST-9...",result));    
      
      }
  }
  
  class Driver{
      public boolean run(String s, String expected){
  
          PLACEHOLDER_CLS_NAME sol = new PLACEHOLDER_CLS_NAME();
          return validateSolution(sol.PLACEHOLDER_FN_NAME(s),expected);
      }
      
      public boolean validateSolution(String actual, String expected){
          return actual.equals(expected);
      }
  }
  
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
question_info.test_case_ids: 0 1 2 3 4 5 6 7 8 9
question_info.commands: java __FILENAME__