Search⌘ K

DIY: Valid Parenthesis String

Explore how to determine the validity of a parenthesis string containing '(', ')', and '*'. Understand how to treat '*' as multiple possibilities and implement a function to validate the string according to coding interview rules. This lesson helps you develop problem-solving skills for compiler and string validation challenges.

Problem statement

You are given a string named check. Your task is to find out if this string is valid. This string will only contain three type of characters i.e., (, ), and *.

A string is valid if it follows the following rules:

  • Every left ( parenthesis ...