通过万岁!!!
class Solution {
public String interpret(String command) {
StringBuilder sb = new StringBuilder();
for (int i = 0; i < command.length(); i++) {
switch (command.charAt(i)) {
case 'G':
sb.append('G');
break;
case '(':
if (command.charAt(i + 1) == ')') {
sb.append('o');
i++;
} else {
sb.append("al");
i += 3;
}
break;
default:
break;
}
}
return sb.toString();
}
}