title: Lexicographically Next String
signature: class Solution {
  
      public String lexicographicallyNextString(String s) {
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;
  }
question_info.extension: java
question_info.entry_fn_name: lexicographicallyNextString
question_info.entry_cls_name: Solution
question_info.test_list: [{"idx": 0, "outputs": "amKIRzPiqLTIz", "inputs": {"s": "amKIRzPiqLTIy"}}, {"idx": 1, "outputs": "69", "inputs": {"s": "68"}}, {"idx": 2, "outputs": "110", "inputs": {"s": "100"}}, {"idx": 3, "outputs": "g", "inputs": {"s": "f"}}, {"idx": 4, "outputs": "802206375", "inputs": {"s": "802205375"}}, {"idx": 5, "outputs": "0211", "inputs": {"s": "0111"}}, {"idx": 6, "outputs": "GRjRYIvYwgub", "inputs": {"s": "GRjRYIvYwgua"}}, {"idx": 7, "outputs": "813:910006809", "inputs": {"s": "8139910006809"}}, {"idx": 8, "outputs": "200101", "inputs": {"s": "100101"}}, {"idx": 9, "outputs": "rx", "inputs": {"s": "rw"}}]
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("amKIRzPiqLTIy", "amKIRzPiqLTIz");
          System.out.println(String.format("%s%s","TEST-0...",result));    
      
          result = validateSolution("68", "69");
          System.out.println(String.format("%s%s","TEST-1...",result));    
      
          result = validateSolution("100", "110");
          System.out.println(String.format("%s%s","TEST-2...",result));    
      
          result = validateSolution("f", "g");
          System.out.println(String.format("%s%s","TEST-3...",result));    
      
          result = validateSolution("802205375", "802206375");
          System.out.println(String.format("%s%s","TEST-4...",result));    
      
          result = validateSolution("0111", "0211");
          System.out.println(String.format("%s%s","TEST-5...",result));    
      
          result = validateSolution("GRjRYIvYwgua", "GRjRYIvYwgub");
          System.out.println(String.format("%s%s","TEST-6...",result));    
      
          result = validateSolution("8139910006809", "813:910006809");
          System.out.println(String.format("%s%s","TEST-7...",result));    
      
          result = validateSolution("100101", "200101");
          System.out.println(String.format("%s%s","TEST-8...",result));    
      
          result = validateSolution("rw", "rx");
          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__