Skip to content

Commit 6af599c

Browse files
author
openset
committed
Update: PackageName
1 parent b52dc20 commit 6af599c

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

internal/leetcode/question_data.go

+1-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import (
99
"regexp"
1010
"strconv"
1111
"strings"
12-
"unicode"
1312
)
1413

1514
func QuestionData(titleSlug string, isForce bool, graphQL ...string) (qd questionDataType) {
@@ -199,11 +198,7 @@ func (question *questionType) TitleSnake() string {
199198
}
200199

201200
func (question *questionType) PackageName() string {
202-
snake := question.TitleSnake()
203-
if snake != "" && unicode.IsNumber(rune(snake[0])) {
204-
snake = "p_" + snake
205-
}
206-
return snake
201+
return "problem_" + question.QuestionFrontendId
207202
}
208203

209204
func (question *questionType) SaveCodeSnippet() {

problems/1-bit-and-2-bit-characters/1_bit_and_2_bit_characters.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package p_1_bit_and_2_bit_characters
1+
package problem_717
22

33
func isOneBitCharacter(bits []int) bool {
44
l := len(bits) - 1

problems/1-bit-and-2-bit-characters/1_bit_and_2_bit_characters_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package p_1_bit_and_2_bit_characters
1+
package problem_717
22

33
import "testing"
44

0 commit comments

Comments
 (0)