but maybe with more timewaste.haha

```
class LVP{
public:
int lvp( string s ){
int len = s.size();
if( !len ) // if string is empty, return 0 instantly.
return 0;
for( int i = 0;i < len;i++ )
if( s[i] == ')' )
for( int j = i - 1;j >= 0;j-- ) // for every ')’，find the first match '(' before it
if( s[j] == '(' ) { // and mark the two with a special flag,like '0'
s[i] = '0';
s[j] = '0';
break;
}
int max = 0,temp = 0;
for( int i = 0;i < len;i++ ) { // the problem changed to find the longest '0' in the string
if( s[i] == '0' )
temp++;
else {
max = temp > max ? temp : max;
temp = 0;
}
}
max = temp > max ? temp : max; // longest '0'sequence may still stored in temp
return max;
}
};
```