#3407

Substring Matching Pattern

easy · 28.4% accepted · 116 likes · top 6%

string · string matching

⊣ practice⊣ open on leetcode ↗

Description

You are given a string s and a pattern string p, where p contains exactly one '*' character.

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

Return true if p can be made a substring of s, and false otherwise.

Solution