C++ || Fully Detailed Intuitions Explained  ||No DP || Binary Search + Backtracking || Clean code
Intuition -> We want to divide into minimum no of partitions such that all the tasks gets finished.\n\n## What we are looking to implement is , max size of part
## Intuition -> We want to divide into minimum no of partitions such that all the tasks gets finished.\n\n## What we are looking to implement is , max size of partitions of time can be at max n & min will be 1.\n\n## So we will apply binary search on that, mid will be the our current no. of partitions we taken , we will create a array of size mid for storing the (possible time value ) in each partitions such that max value of each partitions should be less than or equal to sessionTime.\n\n#### By coincidence i have taken the name of array of size mid as dp , it is just for storing it . there is no as such dp (repition thing in this solution).\n\n##  Now we will apply our approach of filling the mid no. of partitions , such that max value of partitions should be less than sessionTime , & each partitions must contain a non zero value in it (Some tasks must be done in each partionised set) , otherwise that case will be invalid .\n\n### so after computation , if dp[j]==0 ,we are return false (Invalid case).\n\n\n## Similar problem :- Minimum Time to finish the Task (Hard)\n\n```\n   int ans=INT_MAX;\n    \n    bool func(vector<int> &nums , int mid , int time , int i , vector<int> &dp )\n    {\n        if(i>=nums.size())\n        {\n            return true;\n        }\n        \n        int val=*max_element(nums.begin() , nums.end());\n        \n        if(val>time)\n        {\n            return false;\n        }\n        \n        for(int j=0;j<mid;j++ )\n        {\n            if(dp[j] + nums[i] <= time)\n            {\n                dp[j]+=nums[i];\n                \n                if(func(nums , mid , time , i+1 , dp))\n                {\n                    return true;\n                }\n                \n                dp[j]-=nums[i];\n                \n                 if(dp[j]==0)\n                {\n                     // we can have all the partitions must have some non zero work value , if any partitions \n\t\t\t\t\t// value==0 , then no of partition is less than  mid which is invalid as we have to have mid \n\t\t\t\t\t// number of partitons , then we have to return false \n                    return false;\n                }\n            }\n        \n        }\n        \n        return false;\n    }\n    \n    int minSessions(vector<int>& nums, int time) {\n        int n=nums.size();\n        \n        int l=1 , r=n;\n        \n        sort(nums.begin() , nums.end() , greater<int>());\n        \n        int ans=-1;\n        \n        while(l<=r)\n        {\n            int mid=(l+r)/2;\n            \n            vector<int> dp(mid , 0);\n            \n            if(func(nums , mid , time , 0 , dp))\n            {\n                ans=mid;\n                r=mid-1;\n            }\n            else\n            {\n                l=mid+1;\n            }\n        }\n        \n        return ans;\n    }\n```
['Backtracking', 'C', 'Binary Tree', 'C++']