Python standard solution
\nclass Solution:\n    def numSubarrayBoundedMax(self, nums: List[int], left: int, right: int) -> int:\n        end,start=-1,-1\n        result=0\n        for i
```\nclass Solution:\n    def numSubarrayBoundedMax(self, nums: List[int], left: int, right: int) -> int:\n        end,start=-1,-1\n        result=0\n        for i in range(len(nums)):  \n            if nums[i]>=left and nums[i]<=right:\n                end=i\n                result+=end-start\n            elif nums[i]>right:\n                start,end=i,i\n            else:\n                result+=end-start\n                \n        return result\n```                \nref video:Youtube channel(code_report)\nIf found helpful **PLEASE UPVOTE.**
['Python']