You are given two strings, pattern and value. The pattern consists of a sequence of * which can match any sequence of characters (including an empty sequence) and + which can match any single character.
The function match returns true if the pattern matches the value and false otherwise.
Implement the function match based on the given specifications:
python def match(pattern, value):
0 <= len(pattern) <= 1000 <= len(value) <= 100Example 1:
Input:
pattern = "abc+*" value = "ab"
Output:
False
Explanation: The pattern can be interpreted as "a followed by b followed by any single character followed by any sequence of characters". The value "ab" does not match this pattern.
Example 2:
Input:
pattern = "*+*+*" value = "a"
Output:
True
Explanation: The pattern can be interpreted as "any sequence of characters followed by 'a' followed by any single character followed by any sequence of characters". The value "a" matches this pattern.
3.Example 3:
Input:
pattern = "*+*+*" value = "aa"
Output:
True
Explanation: The pattern can be interpreted as "any sequence of characters followed by 'a' followed by any single character followed by any sequence of characters". The value "aa" matches this pattern.
Example 4:
Input:
pattern = "*+*+*" value = "b"
Output:
True
Explanation: The pattern can be interpreted as "any sequence of characters followed by 'b' followed by any single character followed by any sequence of characters". The value "b" matches this pattern.