<awangdev>254. Factor Combinations_1.java
public void dfs(List<List<Integer>> rst, List<Integer> list, int num, Integer lastFactor) {
        if (lastFactor != null) { 
            list.add(num);
            rst.add(new ArrayList<>(list));
            list.remove(list.size() - 1);
        }
        int high = (int) Math.sqrt(num);
        int low = lastFactor == null ? 2 : Math.max(2, lastFactor);
        while (low <= high) {
            if (num % low == 0) {
                list.add(low);
                dfs(rst, list, num / low, low);
                list.remove(list.size() - 1);
            }
            low++;
        }
    }
public void sample_funcname ( List < List < Integer >> rst , List < Integer > list , int num , Integer lastFactor ) {
  if ( lastFactor != null ) {
    list . add ( num ) ;
    rst . add ( new ArrayList < > ( list ) ) ;
    list . remove ( list . size ( ) - 1 ) ;
  }
  int high = ( int ) Math . sqrt ( num ) ;
  int low = lastFactor == null ? 2 : Math . max ( 2 , lastFactor ) ;
  while ( low <= high ) {
    if ( num % low == 0 ) {
      list . add ( low ) ;
      dfs ( rst , list , num / low , low ) ;
      list . remove ( list . size ( ) - 1 ) ;
    }
    low ++ ;
  }
}
