Incorrect parentheses combination algorithm