Shortest Matching Substring
You are given a string s and a pattern string p, where p contains exactly two '*' characters.
The '*' in p matches any sequence of zero or more characters.
Return the length of the shortest substring in s that matches p. If there is no such substring, return -1.
Note: The empty substring is considered valid.
Examples
Input: ["abaacbaecebce","ba*c*ce"]
Output: 8
Input: ["baccbaadbc","cc*baa*adb"]
Output: -1
Hints
Split `p` into three parts `a`, `b`, and `c` around the two `'*'` characters.
A substring matches when it starts with `a`, ends with `c`, and contains `b` between them in order (each part may be empty).
Find valid occurrences of each part in `s` and combine the earliest compatible positions to minimize the total length.
Shortest Matching Substring
You are given a string `s` and a pattern string `p`, where `p` contains exactly two `'*'` characters.