题目描述:点击
1 class Solution { 2 public: 3 int longestValidParentheses(string s) { 4 // Start typing your C/C++ solution below 5 // DO NOT write int main() function 6 stack lefts; 7 int len = s.length(); 8 int * f = new int [len]; 9 int rlt = 0;10 int i ;11 for (i=0; irlt)34 rlt = tlen ;35 i += 2*f[i];36 }37 }38 delete []f;39 return 2 * rlt;40 }41 };