Easy C++ Solution
\nclass Solution {\npublic:\n    int Requirement(vector<int>& nums,int right,int left){\n        int cnt=0,j=0;\n        \n        for(int i=0;i<nums.size();i++
```\nclass Solution {\npublic:\n    int Requirement(vector<int>& nums,int right,int left){\n        int cnt=0,j=0;\n        \n        for(int i=0;i<nums.size();i++){\n            if(nums[i]>right) j=0;\n            else j++;\n            cnt+=j;\n        }\n        return cnt;\n    }\n    int numSubarrayBoundedMax(vector<int>& nums, int left, int right) {\n        return Requirement(nums,right,0)-Requirement(nums,left-1,0);\n    }\n};\n```
['C']