Skip to content

Commit 96b0690

Browse files
authored
Create 1678. Goal Parser Interpretation
1 parent d341eca commit 96b0690

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

1678. Goal Parser Interpretation

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
class Solution {
2+
public:
3+
string interpret(string command) {
4+
string ans;
5+
6+
for(int i=0; i<command.length(); i++)
7+
{
8+
if(command[i]=='(' && command[i+1]==')')
9+
{
10+
ans+='o';
11+
}
12+
else
13+
{
14+
if(command[i] != '(' && command[i]!=')')
15+
ans+=command[i];
16+
}
17+
}
18+
return ans;
19+
}
20+
};

0 commit comments

Comments
 (0)