Longest Valid Parentheses <4> <4>

My own solution.