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

Method isMatch

java/0010-regular-expression-matching.java:3–7  ·  view source on GitHub ↗
(String s, String p)

Source from the content-addressed store, hash-verified

1class Solution {
2
3 public boolean isMatch(String s, String p) {
4 boolean[][] cache = new boolean[s.length() + 1][p.length() + 1];
5
6 return dfs(cache, s, p, 0, 0);
7 }
8
9 private boolean dfs(boolean[][] cache, String s, String p, int i, int j) {
10 if (cache[i][j] != false) return cache[i][j];

Callers

nothing calls this directly

Calls 1

dfsMethod · 0.95

Tested by

no test coverage detected