algoadvance

Leetcode Question: 678 *****************************
678. Valid Parenthesis String
*****************************

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

The following rules define a valid string:

 

Example 1:

Input: s = "()"
Output: true

Example 2:

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

Example 3:

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

 

Constraints:





Solutions: Python   Java  C++
Cut study time in HALF and DOMINATE your interview with AlgoAdvance AI