Search
⌘K

Leetcode 2267. Check if There Is a Valid Parentheses String Path

Given an m×n grid of '(' and ')', determine whether there exists a down/right path from the top-left to bottom-right whose concatenated characters form a valid parentheses string. The core challenge is exploring paths while tracking a feasible parentheses balance (never negative and zero at the end), typically handled by DP/BFS over positions augmented with balance and aggressive pruning.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.