longestValidParentheses.cpp
begin to calculate the longest value