diff --git a/leetcode/question.go b/leetcode/question.go index 69d38b25..e6b6b9e7 100644 --- a/leetcode/question.go +++ b/leetcode/question.go @@ -442,7 +442,10 @@ func (q *QuestionData) ParseExampleOutputs() []string { result := make([]string, 0, len(found)) // TODO multi-line output, like https://leetcode.cn/problems/find-valid-matrix-given-row-and-column-sums/ for _, f := range found { - output := strings.TrimSuffix(strings.TrimPrefix(strings.TrimSpace(f[1]), ""), "") + output := strings.TrimSpace(f[1]) + output = strings.TrimPrefix(output, "") + output = strings.TrimSuffix(output, "") + output = strings.TrimSuffix(output, "") output = html2text.HTMLEntitiesToText(output) output = strings.ReplaceAll(output, ", ", ",") result = append(result, output)