Configurable Valid Brackets
Updated
Problem statement
Each two-character string in pairs gives an opening and its matching closing character. Ignore text characters absent from all pairs. Return true when configured delimiters are correctly nested and completely closed.
Function
validConfiguredParentheses(text: String, pairs: String[]) → booleanExamples
Example 1
text = "x<aAb>y"pairs = ["<>","aA","bB"]return = falseThe closer b does not match the expected A.
Constraints
- Every pair has length two.
- Pair characters are globally distinct.
text.length <= 10^6.
More Maven Clinic interview questions
- Minimum Appointment Cancellations with a Required BreakPHONE SCREEN · Seen Jun 2026
- Shortest Currency Conversion with Three-Decimal RatePHONE SCREEN · Seen Mar 2026
- Meeting Rooms IIPHONE SCREEN · Seen Aug 2025
- Possible BipartitionPHONE SCREEN · Seen Aug 2024
- Paginate Provider Listings with Per-Page DiversityONSITE INTERVIEW · Seen Apr 2026
- Longest Valid ParenthesesONSITE INTERVIEW · Seen Aug 2025
Similar questions at other companies
- Most Frequent Call Path From Function Trace LogsRoblox · PHONE SCREENRoblox interview questions
- Number Words to Digits in Any LanguageMicrosoft · ONSITE INTERVIEWMicrosoft interview questions
- Simplify a Formula with Known and Unknown VariablesBetter.com · PHONE SCREEN
- Configurable Valid ParenthesesBloomberg LP · PHONE SCREENBloomberg LP interview questions
- Number of AtomsAmazon · ONSITE INTERVIEW
- Business Account KYC Verification — Parts 1–5Stripe · PHONE SCREENStripe interview questions
- File System Shell CommandsHarvey · ONSITE INTERVIEWHarvey interview questions
- Fuzzy Word Lookup With One Misspelled LetterMeta · PHONE SCREENMeta interview questions
- Group Timestamps into Consecutive-Day IntervalsDuolingo · PHONE SCREENDuolingo interview questions
- Shortest Uncommon SubstringAirbnb · ONSITE INTERVIEWAirbnb interview questions