1. Decode Stringhistorical

    Decode strings in k[encoded_string] form using a stack.

  2. Longest Valid Parentheseshistorical

    Use a stack to mark matched parentheses, then count the longest consecutive valid interval.

  3. Remove Invalid Parentheseshistorical

    Enumerate whether to keep or remove each character, then keep the longest valid-parentheses results.

  4. Generate Parentheseshistorical

    Generate parentheses using full enumeration with a stack, and pruning based on remaining left/right parentheses.

  5. Valid Parentheseshistorical

    Validate a parentheses sequence using a stack or repeated string replacement.