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

Function addRightFrequency

javascript/0076-minimum-window-substring.js:51–62  ·  view source on GitHub ↗
(s, right, frequencyMap, matched)

Source from the content-addressed store, hash-verified

49};
50
51const addRightFrequency = (s, right, frequencyMap, matched) => {
52 const char = s[right];
53
54 if (frequencyMap.has(char)) {
55 frequencyMap.set(char, frequencyMap.get(char) - 1);
56
57 const isInWindow = 0 <= frequencyMap.get(char);
58 if (isInWindow) matched++;
59 }
60
61 return matched;
62};
63
64const subtractLeftFrequency = (s, left, frequencyMap, matched) => {
65 const char = s[left];

Callers 1

getWindowPointersFunction · 0.70

Calls 2

setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected