Goal Parser Interpretation

Easy

Parse a command string where G stays G, () becomes o and (al) becomes al. Return the interpreted string.

Example 1

interpret()
Input
command = "G()(al)"
Output
"Goal"

Example 2

interpret()
Input
command = "G()()()()(al)"
Output
"Gooooal"
Constraints
1 <= command.length <= 100
`command` only contains `G`, `()` and `(al)`.

Topics

Strings

Implement interpret in the editor and return the answer — printing it is never graded.