C++||Two Pointers||Easy to Understand
```\nclass Solution {\npublic:\n    int numSubarrayBoundedMax(vector& nums, int left, int right) \n    {\n       int res=0,l=-1,r=-1;\n        for(int i=0;irigh
```\nclass Solution {\npublic:\n    int numSubarrayBoundedMax(vector<int>& nums, int left, int right) \n    {\n       int res=0,l=-1,r=-1;\n        for(int i=0;i<nums.size();i++)\n        {\n            if(nums[i]>right)\n                l=i;\n            if(nums[i]>=left)\n                r=i;\n            res+=r-l;\n        }\n        return res;\n    }\n};\n//if you like the solution plz upvote.
['Two Pointers', 'C']