Javascript multi knapsack
\nconst counter = (a_or_s) => { let m = new Map(); for (const x of a_or_s) m.set(x, m.get(x) + 1 || 1); return m; };\n\nconst mod = 1e9 + 7;\nconst countSubMult
```\nconst counter = (a_or_s) => { let m = new Map(); for (const x of a_or_s) m.set(x, m.get(x) + 1 || 1); return m; };\n\nconst mod = 1e9 + 7;\nconst countSubMultisets = (a, l, r) => {\n    let f = Array(r + 1).fill(0), m = counter(a), res = 0;\n    f[0] = 1;\n    for (const [x, occ] of m) {\n        if (x == 0) {\n            f = f.map(e => e * (occ + 1));\n        } else {\n            for (let i = x; i <= r; i++) {\n                f[i] += f[i - x];\n                f[i] %= mod;\n            }\n            for (let i = r; i >= (occ + 1) * x; i--) {\n                f[i] -= f[i - (occ + 1) * x];\n                f[i] %= mod;\n            }\n        }\n    }\n    for (let i = l; i <= r; i++) {\n        res += f[i];\n        res %= mod;\n    }\n    return (res + mod) % mod;\n};\n```
['Dynamic Programming', 'JavaScript']