Problem Description

Given a string s containing only three types of characters: '('')' and '*', return true if s is valid.

The following rules define a valid string:

Examples

Example 1:

Input: s = "()"
Output: true

Example 2:

Input: s = "(*)"
Output: true

Example 3:

Input: s = "(*))"
Output: true

Constraints:

解析

給定一個字串 s, 其中字串只能由 3 種字元所組成 ‘(’, ‘*’, ‘)’