import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { //Hashset of V array solutions public static HashSet solutionSet = new HashSet<>(); public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); ArrayList m = new ArrayList<>(); for(int m_i=0; m_i < n; m_i++){ m.add(in.nextInt()); } // your code goes here reverseEngineer(m,new ArrayList>); System.out.println(solutionSet); } public static void reverseEngineer(ArrayList targetArr, int[][] currentSolution){ // Get the arraylist of the next batch // For each possibility //for(){ int lastIntRemoved = 0; // Add things to the front of current Solution, and remove from targetArr while(targetArr.get(targetArr.size()-1)<=lastIntRemoved){ } //If nothing left in targetArr, return if(targetArr.size() == 0){ solutionSet.add(currentSolution,0); } else{ //Call itself again reverseEngineer(targetArr, currentSolution); } //} return; } }