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

Function search

javascript/0097-interleaving-string.js:153–165  ·  view source on GitHub ↗
(s1, s2, s3, tabu)

Source from the content-addressed store, hash-verified

151 ); /* Time O(M) | Space O(M) */
152
153var search = (s1, s2, s3, tabu) => {
154 const [rows, cols] = [s1.length, s2.length];
155
156 for (let row = 0; row <= rows; row++) {
157 /* Time O(N) */
158 for (let col = 0; col <= cols; col++) {
159 /* Time O(M) */
160 tabu[row][col] =
161 /* Space O(N * M) */
162 hasMatch(s1, s2, s3, row, col, tabu);
163 }
164 }
165};
166
167var hasMatch = (s1, s2, s3, i, j, tabu) => {
168 const isBaseCase1 = i === 0 && j === 0;

Callers 1

isInterleaveFunction · 0.70

Calls 1

hasMatchFunction · 0.85

Tested by

no test coverage detected