title: Lexicographically Next String
signature: function lexicographicallyNextString(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("amKIRzPiqLTIy", "amKIRzPiqLTIz");
    console.log(`TEST-0...${result}`);
  
    result = driver("68", "69");
    console.log(`TEST-1...${result}`);
  
    result = driver("100", "110");
    console.log(`TEST-2...${result}`);
  
    result = driver("f", "g");
    console.log(`TEST-3...${result}`);
  
    result = driver("802205375", "802206375");
    console.log(`TEST-4...${result}`);
  
    result = driver("0111", "0211");
    console.log(`TEST-5...${result}`);
  
    result = driver("GRjRYIvYwgua", "GRjRYIvYwgub");
    console.log(`TEST-6...${result}`);
  
    result = driver("8139910006809", "813:910006809");
    console.log(`TEST-7...${result}`);
  
    result = driver("100101", "200101");
    console.log(`TEST-8...${result}`);
  
    result = driver("rw", "rx");
    console.log(`TEST-9...${result}`);
  
  };
  
  main();
source_py: def lexicographically_next_string(s):
      if (s == ' '):
          return 'a'
      i = (len(s) - 1)
      while ((s[i] == 'z') and (i >= 0)):
          i -= 1
      if (i == (- 1)):
          s = (s + 'a')
      else:
          s = s.replace(s[i], chr((ord(s[i]) + 1)), 1)
      return s
source_cpp: string lexicographically_next_string(string s) {
    if ( s == "" ) return "a";
    int i = s . length ( ) - 1;
    while ( s [ i ] == 'z' && i >= 0 ) i --;
    if ( i == - 1 ) s = s + 'a';
    else s [ i ] ++;
    return s;
  }