Valid parentheses sequence

In reply to VE:

// can never have more close than open parenthesis in sequence
        parens.sum() with(item.index<=i? int'(item) : 0) >= 0;