You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// printing all combinations of all numbers given in an array. Make sure you implement toString() method in your custom object type<T>, only then the combinations can be properly serialized into string and at the end they can be deserialized
// back for fast processing.
// example usage:
// ArrayList<Integer> list = new ArrayList<>();
// for(int i=1;i<7;i++) {
// list.add(i);
// }
// printCombinations(list,"");
// Author: Venkat Kongara
public static <T> String printCombinations(ArrayList<T>array,String previous) {