Back to all patterns

Greedy with Range

1 problems • Practice on LeetCode to earn credits

About This Pattern

Master the Greedy with Range pattern by practicing these problems organized by difficulty.Focus on the Key Signals - these are the indicators that tell you when to use this pattern.

Medium (1)

Valid Parenthesis String

Check if string with '(', ')', and '*' (can be '(', ')' or empty) is valid.

Key Signals:

Track min/max open count* gives three choicesCheck range validity