User blog comment:LittlePeng9/Random Turing machines/@comment-5529393-20130408132904/@comment-5529393-20130410143616

Thanks for the help. But how do you check for rightmost set of balanced parentheses? I can't come up with an efficient algorithm.