C++ || Detailed Explanation || DP || Clean & Concise
*Intuition:\n\n## We are taking the res variable for storing the min sum of the possibility of  the size of the window .\n\n## In the dp array we will store the
# ****Intuition:\n\n## We are taking the res variable for storing the min sum of the possibility of  the size of the window .\n\n## In the dp array we will store the min length of the possibility of the window .\n## \tIF dp[start-1]==INT_MAX , this is the 1st one window which is found , previously there does not exist any window of target . \n\n## we storing in the dp[end]=len , to check there exist the any window previously of value target .\n\n# ****IF FIND THIS SOLUTION HELPFUL , PLEASE UPVOTE !!!\n\n```\n int minSumOfLengths(vector<int>& nums, int target) {\n        int n=nums.size();\n        \n        int start=0;\n        \n        int  res=INT_MAX;\n        vector<int> dp(n , INT_MAX);\n        \n        int len=INT_MAX , curr_len;\n        \n        int sum=0;\n        \n        for(int end=0;end<n;end++)\n        {\n            sum+=nums[end];\n            \n            while(sum>target)\n            {\n                sum-=nums[start];\n                start++;\n            }\n            \n            if(sum==target)\n            {\n                curr_len=(end-start+1);\n                \n                if(start>0 && dp[start-1]!=INT_MAX) // checking  for  the pair existent of 2 \n                {\n                    res=min(res , dp[start-1] + curr_len);\n                }\n                \n                len=min(len , curr_len);\n                \n                // update the minlength and store in dp array s.t at least one target exist \n                \n                \n                    \n            }\n            \n            dp[end]=len;\n            \n        }\n        \n        if(res==INT_MAX)\n        {\n            return -1;\n        }\n        \n        return res;\n            \n    }\n```
['Dynamic Programming', 'C', 'C++']