class Solution {
public:
string interpret(string command) {
string res;
for(int i=0;i<command.length();i++){
if(command[i]=='G')
res+='G';
else if(command[i]=='('){
if(command[++i]==')')
res+='o';
else{
res+="al";
i+=2;
}
}
}
return res;
}
};
1678. 设计 Goal 解析器
最新推荐文章于 2024-10-16 18:29:10 发布