C++ | Backtracking
1.Here we will create groups of hours whose sum is less than SessionTime .\n2.basically we will store only the sum of hours in grps array which is less than Ses
1.Here we will create **groups** of hours whose sum is less than `SessionTime` .\n2.basically we will store only the sum of hours in `grps` array which is less than `SessionTime` .\n3.Our aim is to minimize such number of groups to get minimum number of week sessions.\n\nSo, this is how  we gonna create `grps` array : \ncase 1: if **current element + sum**  is less than `SessionTime` , then we will add the element in previously created grps.\nelse \ncase 2: we will create new group in grps array.\n```\nclass Solution {\npublic:\n    int ans=INT_MAX;\n    void solve(int start, vector<int>& v, int target,vector<int>& grps){\n        if(start>=v.size()){\n            int temp = grps.size();\n            ans=min(ans,temp);\n            return ;\n        }\n        if(grps.size()>ans)return;  // if grps size is greater than previously found size then we dont need to check this answer \n\t\t\n        //Case 1\n        int ans=INT_MAX;\n        for(int i=0;i<grps.size();i++){\n            if(grps[i]+v[start]<=target){\n                grps[i]+=v[start];\n                solve(start+1,v,target,grps);\n                grps[i]-=v[start];\n            }\n        }\n        //Case 2\n        grps.push_back(v[start]);\n        solve(start+1,v,target,grps);\n        grps.pop_back();        \n    }\n    int minSessions(vector<int>& v, int target) {\n        int n=v.size();\n        vector<int>grps;\n        solve(0,v,target,grps);\n        return ans;\n    }\n};\n```
['Backtracking', 'C', 'C++']