package leetcode;

/**
 * https://leetcode.com/problems/goal-parser-interpretation/
 */
public class Problem1678 {
    public String interpret(String command) {
        // TODO
        return null;
    }

    public static void main(String[] args) {
        Problem1678 prob = new Problem1678();
        System.out.println(prob.interpret("G()(al)")); // "Goal"
        System.out.println(prob.interpret("G()()()()(al)")); // "Gooooal"
        System.out.println(prob.interpret("(al)G(al)()()G")); // "alGalooG"
    }
}

@@ -12,16 +12,49 @@
 tcode;%0A%0A
+import java.util.regex.Pattern;%0A%0A
 /**%0A * h
@@ -199,199 +199,62 @@
     
-// TODO%0A        return null;%0A    %7D%0A%0A    public static void main(String%5B%5D args) %7B%0A        Problem1678 prob = new Problem1678();%0A        System.out.println(prob.interpret(%22G()(al)%22)); // %22Go
+return command.replaceAll(Pattern.quote(%22(al)%22), %22
 al%22
+)
 %0A   
@@ -262,149 +262,50 @@
     
-System.out.println(prob.interpret(%22G()()()()(al)%22)); // %22Gooooal%22%0A        System.out.println(prob.interpret(%22(al)G(al)()()G%22)); // %22alGalooG%22
+    .replaceAll(Pattern.quote(%22()%22), %22o%22);
 %0A   

Solve problem 1678