← All questions
Coding
Validate Parentheses String with Wildcards
Asked at
Vegapay
1Give yourself 5 minutes
2Answer out loud, not in your head
3Then compare with the answer below
0
Stuck? Show a way to structure it+
- 01Track lowest and highest possible open counts
- 02Update both bounds for each character
- 03Reject when the high bound is negative
- 04Clamp the low bound at zero
- 05Accept only if low is zero at the end
Reference answer
Then expect these follow-ups
Why is the feasible range contiguous?
Tests: correctness reasoning
How would you construct one valid interpretation?
Tests: follow-up reasoning
Hiring now
Vegapay has 17 open roles right now
landed applies to roles like these for you, on each company’s own site, with answers written for the role.
Get 5x interviews10 free auto-applies. No card.
Software Development Engineer - Frontend
Bengaluru
Senior Software Engineer - Backend
Bengaluru
Associate Product Director
Bengaluru
Next question