Finding the Users Active Minutes LeetCode solution in JavaScript
1var findingUsersActiveMinutes = function (logs, k) {2const map = new Map();34for (const [userID, minute] of logs) {5if (!map.has(userID)) map.set(userID, new Set());6map.get(userID).add(minute);7}89const count = new Array(k).fill(0);1011for (const actions of map.values()) {12count[actions.size - 1]++;13}1415return count;16};