Skip to content

Commit c8fb46d

Browse files
add 1678
1 parent 16f168e commit c8fb46d

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ _If you like this project, please leave me a star._ ★
88

99
| # | Title | Solutions | Video | Difficulty | Tag
1010
|-----|----------------|---------------|--------|-------------|-------------
11+
|1678|[Goal Parser Interpretation](https://leetcode.com/problems/goal-parser-interpretation/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1678.java) ||Easy|String|
1112
|1673|[Find the Most Competitive Subsequence](https://leetcode.com/problems/find-the-most-competitive-subsequence/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1673.java) ||Medium|Stack, Greedy|
1213
|1672|[Richest Customer Wealth](https://leetcode.com/problems/richest-customer-wealth/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1672.java) ||Easy|Array|
1314
|1669|[Merge In Between Linked Lists](https://leetcode.com/problems/merge-in-between-linked-lists/)|[Solution](../master/src/main/java/com/fishercoder/solutions/_1669.java) ||Medium|LinedList|
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package com.fishercoder.solutions;
2+
3+
public class _1678 {
4+
public static class Solution1 {
5+
public String interpret(String command) {
6+
StringBuilder sb = new StringBuilder();
7+
for (int i = 0; i < command.length(); i++) {
8+
if (command.charAt(i) == 'G') {
9+
sb.append("G");
10+
} else if (command.charAt(i) == '(' && command.charAt(i + 1) == ')') {
11+
sb.append("o");
12+
i++;
13+
} else if (command.charAt(i) == '(' && command.charAt(i + 1) == 'a') {
14+
sb.append("al");
15+
i += 3;
16+
}
17+
}
18+
return sb.toString();
19+
}
20+
}
21+
}

0 commit comments

Comments
 (0)