<awangdev>Letter Combinations of a Phone Number_2.java
public void helper(ArrayList<String> rst, ArrayList<String> list, 
        ArrayList<String[]> map, String digits, int level){
        if (level == digits.length()) {
            StringBuffer sb = new StringBuffer();
            for (String s : list) {
                sb.append(s);
            }
            rst.add(sb.toString());
            return;
        }
        int num = Integer.parseInt(digits.substring(level, level + 1));
        String[] strs = map.get(num);

        for (int i = 0; i < strs.length; i++) {
            list.add(strs[i]);
            helper(rst, list, map, digits, level + 1);
            list.remove(list.size() - 1);
        }
    }
public void sample_funcname ( ArrayList < String > rst , ArrayList < String > list , ArrayList < String [ ] > map , String digits , int level ) {
  if ( level == digits . length ( ) ) {
    StringBuffer sb = new StringBuffer ( ) ;
    for ( String s : list ) {
      sb . append ( s ) ;
    }
    rst . add ( sb . toString ( ) ) ;
    return ;
  }
  int num = Integer . parseInt ( digits . substring ( level , level + 1 ) ) ;
  String [ ] strs = map . get ( num ) ;
  for ( int i = 0 ;
  i < strs . length ;
  i ++ ) {
    list . add ( strs [ i ] ) ;
    helper ( rst , list , map , digits , level + 1 ) ;
    list . remove ( list . size ( ) - 1 ) ;
  }
}
