🔥🔥🔥 Python Simple Solution 🔥🔥🔥
Intuition\n Describe your first thoughts on how to solve this problem. \n\n# Approach\n Describe your approach to solving the problem. \n\n# Complexity\n- Time 
# Intuition\n<!-- Describe your first thoughts on how to solve this problem. -->\n\n# Approach\n<!-- Describe your approach to solving the problem. -->\n\n# Complexity\n- Time complexity: O(nr)\n<!-- Add your time complexity here, e.g. $$O(n)$$ -->\n\n- Space complexity: O(r)\n<!-- Add your space complexity here, e.g. $$O(n)$$ -->\n\n# Code\n```\nclass Solution:\n    def countSubMultisets(self, nums: List[int], l: int, r: int) -> int:\n        dp = defaultdict(int)\n        dp[0] = 1\n        counter = Counter(nums)\n        for num, count in counter.items():\n            for i in range(num):\n                total = sum(dp[r-i-num*c] for c in range(1, count+1))\n                for n in range(r-i, 0, -num):\n                    dp[n] += total\n                    total = total - dp[n-num] + dp[n-num*(count+1)]\n\n        res = 0\n        for i in range(l, r+1):\n            res = (res + dp[i]) % (10**9 + 7)\n        return res * (counter[0] + 1) % (10**9 + 7)\n\n```
['Python3']