Tap here to switch tabs
Problem
Submissions

Problem: Goal Parser Interpretation

med
30 min
Try to solve the Goal Parser Interpretation problem.

Statement

You are given a string command that consists of a sequence of tokens. A parser interprets the input string by applying the following mappings:

  • "G" is interpreted as "G"

  • "()" is interpreted as "o"

  • "(al)" is interpreted as "al"

Return the final interpreted string after translating all tokens in command.

Constraints:

  • 1≤1 \leq command.length ≤100\leq 100

  • command consists of "G", "()", and/or "(al)" in some order.

⋮
Tap here to switch tabs
Problem
Submissions

Problem: Goal Parser Interpretation

med
30 min
Try to solve the Goal Parser Interpretation problem.

Statement

You are given a string command that consists of a sequence of tokens. A parser interprets the input string by applying the following mappings:

  • "G" is interpreted as "G"

  • "()" is interpreted as "o"

  • "(al)" is interpreted as "al"

Return the final interpreted string after translating all tokens in command.

Constraints:

  • 1≤1 \leq command.length ≤100\leq 100

  • command consists of "G", "()", and/or "(al)" in some order.