Adding Cycle Detection and Valid Parentheses solutions