MCPcopy Create free account
hub / github.com/neetcode-gh/leetcode / initMemo

Function initMemo

javascript/0010-regular-expression-matching.js:58–63  ·  view source on GitHub ↗
(text, pattern)

Source from the content-addressed store, hash-verified

56};
57
58var initMemo = (text, pattern) =>
59 new Array(text.length + 1)
60 .fill() /* Time O(N) | Space O(N) */
61 .map(() =>
62 new Array(pattern.length + 1).fill(false),
63 ); /* Time O(M) | Space O(M) */
64
65var check = (text, pattern, row, col, memo) => {
66 const isTextDefined = row < text.length,

Callers 1

isMatchFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected