class Solution {
public String interpret(String command) {
char[] ch = command.toCharArray();
int n = ch.length;
StringBuilder sb = new StringBuilder();
for(int i = 0 ; i < n; i ++) {
if (ch[i] == 'G') sb.append(ch[i]);
if (ch[i] == '(') {
i++;
if (ch[i] == ')') {
sb.append('o');
}
else {
sb.append("al");
i+=2;
}
}
}
return sb.toString();
}
}
标签:解析器,ch,Goal,1678,sb,append
From: https://www.cnblogs.com/eiffelzero/p/16861815.html