标签:strlen outer move import turn eof int tco sizeof
char * removeOuterParentheses(char * S){
int len = strlen(S),count=1,n=0;
char* ret = (char*)calloc(len,sizeof(char*));
for (int i=1; i<len; i++)
{
(S[i] == ‘(‘)? count++: count--;
if(count) ret[n++] = S[i];
else count=1,i++;
}
return ret;
}
标签:strlen outer move import turn eof int tco sizeof
原文地址:https://www.cnblogs.com/ganxiang/p/13636960.html