Given an integer array nums, return all the different possible increasing subsequences of the given array with at least two elements. You may return the answer in any order.

The given array may contain duplicates, and two equal integers should also be considered a special case of increasing sequence.

&nbsp;
Example 1:

Input: nums = [4,6,7,7]
Output: [[4,6],[4,6,7],[4,6,7,7],[4,7],[4,7,7],[6,7],[6,7,7],[7,7]]


Example 2:

Input: nums = [4,4,3,2,1]
Output: [[4,4]]


&nbsp;
Constraints:


	1 &lt;= nums.length &lt;= 15
	-100 &lt;= nums[i] &lt;= 100


class Solution:
    def findSubsequences(self, nums: List[int]) -> List[List[int]]:
        def backtracking(nums,path):
           # to ensure that the base array has at least 2 elements
            if len(path)>=2:
                res.add(tuple(path))
            for i in range(len(nums)):
                # to ensure that every element to be added is equal or larger than the former
                if not path or path[-1] <= nums[i]:
                    backtracking(nums[i+1:],path+[nums[i]])

        res=set()
        backtracking(nums,[])
        return res
class Solution {
    HashSet<List<Integer>> set;
    public List<List<Integer>> findSubsequences(int[] nums) {
        set=new HashSet<>();

        dfs(nums,0,new ArrayList<>());

        List<List<Integer>> ans=new ArrayList<>();
        if(set.size()>0){
            ans.addAll(set);
        }
        return ans;
    }

    private void dfs(int nums[], int start, List<Integer> temp){
        if(start==nums.length) return;

        for(int i=start;i<nums.length;i++){
            if(temp.size()==0 || temp.get(temp.size()-1)<=nums[i]){
                temp.add(nums[i]);

                if(temp.size()>=2) set.add(new ArrayList<>(temp));

                dfs(nums,i+1,temp);
                temp.remove(temp.size()-1);
            }
        }
    }
}
class Solution {
public:
    set<vector<int>>ans;
    void solve(int start, int n, vector<int>&nums, vector<int>&result){
        if(result.size()>1)ans.insert(result);
        if(start==n){
            return;
        }
        for(int i=start; i<n; i++){
            if(result.empty() || result.back()<=nums[i]){
                result.push_back(nums[i]);
                solve(i+1, n, nums, result);
                result.pop_back();
            }
        }
        
    }
    vector<vector<int>> findSubsequences(vector<int>& nums) {
        int n = nums.size();
        vector<int>result;
        solve(0, n, nums, result);
        return vector<vector<int>>(ans.begin(), ans.end());
    }
};
var findSubsequences = function(nums) {
    
    const result = [];
    const set = new Set();
    
    function bt(index=0,ar=[]){
        if(!set.has(ar.join("_")) && ar.length >=2){
            set.add(ar.join("_"));
            result.push(ar);
        }
        for(let i =index; i<nums.length; i++){
            if(nums[i] >= ar[ar.length-1] || ar.length===0){
                bt(i+1, [...ar, nums[i]]);
            }
        }
    }
    
    bt();
    return result;
};
Increasing Subsequences