Tap here to switch tabs
Problem
Submissions

Problem: Substring Matching Pattern

med
30 min
Try to solve the Substring Matching Pattern problem.

Statement

You are given a string s and a pattern string p. The pattern p contains lowercase English letters and exactly one '*' character.

The '*' character can be replaced with any sequence of zero or more characters.

Return true if p can match any substring of s after replacing the '*', and false otherwise.

Note: A substring is a contiguous non-empty sequence of characters within a string.

Constraints:

  • 1≤1 \leq s.length ≤50\leq 50

  • 1≤1 \leq p.length ≤50\leq 50

  • s contains only lowercase English letters.

  • p contains only lowercase English letters and exactly one '*'.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Substring Matching Pattern

med
30 min
Try to solve the Substring Matching Pattern problem.

Statement

You are given a string s and a pattern string p. The pattern p contains lowercase English letters and exactly one '*' character.

The '*' character can be replaced with any sequence of zero or more characters.

Return true if p can match any substring of s after replacing the '*', and false otherwise.

Note: A substring is a contiguous non-empty sequence of characters within a string.

Constraints:

  • 1≤1 \leq s.length ≤50\leq 50

  • 1≤1 \leq p.length ≤50\leq 50

  • s contains only lowercase English letters.

  • p contains only lowercase English letters and exactly one '*'.