c++ solution
\nclass Solution {\npublic:\n    int find(vector<int>&nums,int k)\n    {\n        int j=0;\n        int ans=0;\n        for(int i=0;i<nums.size();i++)\n        
```\nclass Solution {\npublic:\n    int find(vector<int>&nums,int k)\n    {\n        int j=0;\n        int ans=0;\n        for(int i=0;i<nums.size();i++)\n        {\n            if(nums[i]>k)\n            {\n                j=i+1;\n            }\n            ans+=i-j+1;\n        }\n        return ans;\n    }\n    int numSubarrayBoundedMax(vector<int>& A, int L, int R) {\n        return find(A,R)-find(A,L-1);\n    }\n};\n```
['C', 'C++']