var threeSumMulti = function (arr, target) { constMOD = 10 ** 9 + 7; const count = newMap(); for (const num of arr) { count.set(num, (count.get(num) || 0) + 1); }
const keys = [...count.keys()].sort((a, b) => a - b); let result = 0;
for (let i = 0; i < keys.length; i++) { const x = keys[i]; for (let j = i; j < keys.length; j++) { const y = keys[j]; const z = target - x - y; if (z < y) continue;