Leetcode 1678. Goal Parser Interpretation Posted on 2021-01-26 In LeetCode 題目1234567Input: command = "G()(al)"Output: "Goal"Explanation: The Goal Parser interprets the command as follows:G -> G() -> o(al) -> alThe final concatenated result is "Goal". 解法思維利用replace()正規表達式 1var interpret =(command)=>command.replace(/\(\)/g,'o').replace(/\((\w)(\w)\)/g,"$1$2");