1678. Goal Parser Interpretation Easy
1/**
2 * [1678] Goal Parser Interpretation
3 *
4 * You own a Goal Parser that can interpret a string command. The command consists of an alphabet of "G", "()" and/or "(al)" in some order. The Goal Parser will interpret "G" as the string "G", "()" as the string "o", and "(al)" as the string "al". The interpreted strings are then concatenated in the original order.
5 * Given the string command, return the Goal Parser's interpretation of command.
6 *
7 * Example 1:
8 *
9 * Input: command = "G()(al)"
10 * Output: "Goal"
11 * Explanation: The Goal Parser interprets the command as follows:
12 * G -> G
13 * () -> o
14 * (al) -> al
15 * The final concatenated result is "Goal".
16 *
17 * Example 2:
18 *
19 * Input: command = "G()()()()(al)"
20 * Output: "Gooooal"
21 *
22 * Example 3:
23 *
24 * Input: command = "(al)G(al)()()G"
25 * Output: "alGalooG"
26 *
27 *
28 * Constraints:
29 *
30 * 1 <= command.length <= 100
31 * command consists of "G", "()", and/or "(al)" in some order.
32 *
33 */
34pub struct Solution {}
35
36// problem: https://leetcode.com/problems/goal-parser-interpretation/
37// discuss: https://leetcode.com/problems/goal-parser-interpretation/discuss/?currentPage=1&orderBy=most_votes&query=
38
39// submission codes start here
40
41impl Solution {
42 pub fn interpret(command: String) -> String {
43 String::new()
44 }
45}
46
47// submission codes end
48
49#[cfg(test)]
50mod tests {
51 use super::*;
52
53 #[test]
54 fn test_1678() {
55 }
56}
57
Back
© 2025 bowen.ge All Rights Reserved.