<gouthampradhan>backtracking_LetterCasePermutation_1.java
private void backtrack(String s, List<String> result, int i, String r) {
    if (i == s.length()) {
      result.add(r);
    } else {
      if (Character.isAlphabetic(s.charAt(i))) {
        backtrack(s, result, i + 1, r + s.charAt(i));
        if (Character.isLowerCase(s.charAt(i))) {
          backtrack(s, result, i + 1, r + Character.toUpperCase(s.charAt(i)));
        } else {
          backtrack(s, result, i + 1, r + Character.toLowerCase(s.charAt(i)));
        }
      } else {
        backtrack(s, result, i + 1, r + s.charAt(i));
      }
    }
  }
private void sample_funcname ( String s , List < String > result , int i , String r ) {
  if ( i == s . length ( ) ) {
    result . add ( r ) ;
  }
  else {
    if ( Character . isAlphabetic ( s . charAt ( i ) ) ) {
      backtrack ( s , result , i + 1 , r + s . charAt ( i ) ) ;
      if ( Character . isLowerCase ( s . charAt ( i ) ) ) {
        backtrack ( s , result , i + 1 , r + Character . toUpperCase ( s . charAt ( i ) ) ) ;
      }
      else {
        backtrack ( s , result , i + 1 , r + Character . toLowerCase ( s . charAt ( i ) ) ) ;
      }
    }
    else {
      backtrack ( s , result , i + 1 , r + s . charAt ( i ) ) ;
    }
  }
}
