MCPcopy Index your code
hub / github.com/neetcode-gh/leetcode / getFrequencyMap

Function getFrequencyMap

javascript/0076-minimum-window-substring.js:18–24  ·  view source on GitHub ↗
(str, frequencyMap = new Map())

Source from the content-addressed store, hash-verified

16};
17
18const getFrequencyMap = (str, frequencyMap = new Map()) => {
19 for (const char of str) {
20 frequencyMap.set(char, (frequencyMap.get(char) || 0) + 1);
21 }
22
23 return frequencyMap;
24};
25
26const getWindowPointers = (s, t, frequencyMap) => {
27 let [left, right, matched, start, end] = [0, 0, 0, 0, s.length + 1];

Callers 1

minWindowFunction · 0.70

Calls 2

setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected