Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void combination(int... combo){
- int index = 0;
- for (int i = 0; i < combo.length; i++){
- index += dictionary[combo[i]].length;
- }
- if (index == number.length()){
- combinations[combCount++] = combo;
- return;
- }
- for (int i = 0; i < dictionary.length; i++){
- if (isWordAccept(i,index)){
- int[] next = new int[combo.length+1];
- for (int j = 0; combo.length > 0 && j < combo.length; j++){
- next[j] = combo[j];
- }
- next[next.length-1]=i;
- combination(next);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement