FPEvalRepoPublic/LeetCodeMetaData
0402
1{2 "id": 3684,3 "name": "substring-matching-pattern",4 "difficulty": "Easy",5 "link": "https://leetcode.com/problems/substring-matching-pattern/",6 "date": "2024-12-21",7 "task_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. **Example 1:** **Input:** s = \"leetcode\", p = \"ee*e\" **Output:** true **Explanation:** By replacing the `'*'` with `\"tcod\"`, the substring `\"eetcode\"` matches the pattern. **Example 2:** **Input:** s = \"car\", p = \"c*v\" **Output:** false **Explanation:** There is no substring matching the pattern. **Example 3:** **Input:** s = \"luck\", p = \"u*\" **Output:** true **Explanation:** The substrings `\"u\"`, `\"uc\"`, and `\"uck\"` match the pattern. **Constraints:** `1 <= s.length <= 50` `1 <= p.length <= 50 ` `s` contains only lowercase English letters. `p` contains only lowercase English letters and exactly one `'*'`",8 "test_case": [9 {10 "label": "Example 1",11 "input": "s = \"leetcode\", p = \"ee*e\"",12 "output": "true "13 },14 {15 "label": "Example 2",16 "input": "s = \"car\", p = \"c*v\"",17 "output": "false "18 },19 {20 "label": "Example 3",21 "input": "s = \"luck\", p = \"u*\"",22 "output": "true "23 }24 ],25 "constraints": [26 "1 <= s.length <= 50",27 "1 <= p.length <= 50",28 "s contains only lowercase English letters.",29 "p contains only lowercase English letters and exactly one '*'"30 ],31 "python_template": "class Solution(object):\n def hasMatch(self, s, p):\n \"\"\"\n :type s: str\n :type p: str\n :rtype: bool\n \"\"\"\n ",32 "java_template": "class Solution {\n public boolean hasMatch(String s, String p) {\n \n }\n}",33 "metadata": {34 "func_name": "hasMatch"35 }36}