public int solve ( int [ ] prefix , SolutionAcceptor < ColumnName > output ) { List < Node < ColumnName >> choices = new ArrayList < Node < ColumnName > > ( ) ; for ( int i = 0 ; i < prefix . length ; ++ i ) { choices . add ( advance ( prefix [ i ] ) ) ; } int result = search ( choices , output ) ; for ( int i = prefix . length - 1 ; i >= 0 ; -- i ) { rollback ( choices . get ( i ) ) ; } return result ; }
Given a prefix find solutions under it .