반응형
오늘 풀 문제는 Goal Parser Interpretation라는 문제이며
링크는 leetcode.com/problems/goal-parser-interpretation/입니다
각각에 해당하는 문자들을 치환해주면 되는 문제로 replace를 사용하였습니다
func interpret(command string) string {
replacer := strings.NewReplacer("()", "o", "(al)", "al")
return replacer.Replace(command)
}
'Language > Go' 카테고리의 다른 글
[Golang으로 도전하는 Leetcode] Max Number of K-Sum Pairs (0) | 2020.12.12 |
---|---|
[Golang으로 도전하는 Leetcode] Goal Parser Interpretation (0) | 2020.12.09 |
[Golang으로 도전하는 Leetcode] Richest Customer Wealth (0) | 2020.12.04 |
[Golang으로 도전하는 Leetcode] Smallest String With A Given Numeric Value (0) | 2020.12.02 |
[Golang으로 도전하는 Leetcode] Ways to Make a Fair Array (0) | 2020.11.30 |