โ† Swiggy questions

Valid Parenthesis String with wildcards

Filed under Swiggy

The question

Given a string containing only '(', ')' and '*', determine if the string is valid where '*' can be treated as '(', ')' or an empty string. Solve in O(n) time and O(1) auxiliary space.

No write-up yet. Related questions below have one.

Related Swiggy questions

Collected from public candidate posts and coding forums. Updated Nov 2026.