QUALYS Hiring | On Campus OA (2021) | Minimum Remove to Make Valid Parentheses

Question · Posted Jun 2026

Problem Statement Given a string s consisting of lowercase English letters and the characters '(' and ')', remove the minimum number of parentheses so that the resulting string is a valid parentheses string. A parentheses string is valid if: Every opening parenthesis '(' has a corresponding closing parenthesis ')'. Every closing parenthesis ')' has a corresponding opening parenthesis '('. Parentheses are properly nested. Return any valid string after performing the minimum number of removals. Example 1 Input s = "lee(t(c)o)de)" ...

The full answer & interview discussion are available to premium members.

Log in Create a free account