Skip to content

Commit c5b88c0

Browse files
author
Shuo
authored
Merge pull request #652 from openset/develop
Update: PackageName
2 parents 7d3b21e + c5ee633 commit c5b88c0

25 files changed

+26
-32
lines changed

internal/leetcode/question_data.go

Lines changed: 1 addition & 6 deletions
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/01-matrix/01_matrix.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package p_01_matrix
1+
package problem_542
22

33
func updateMatrix(matrix [][]int) [][]int {
44
m, n := len(matrix), len(matrix[0])

problems/01-matrix/01_matrix_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package p_01_matrix
1+
package problem_542
22

33
import (
44
"reflect"

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
1-
package p_1_bit_and_2_bit_characters
1+
package problem_717
22

33
func isOneBitCharacter(bits []int) bool {
4-
l := len(bits) - 1
5-
i := 0
4+
i, l := 0, len(bits)-1
65
for i < l {
76
i += bits[i] + 1
87
}

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

Lines changed: 1 addition & 1 deletion
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

problems/132-pattern/132_pattern.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package p_132_pattern
1+
package problem_456
22

33
func find132pattern(nums []int) bool {
44
ak, ajStack := -1<<31, make([]int, 0, len(nums))

problems/132-pattern/132_pattern_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package p_132_pattern
1+
package problem_456
22

33
import "testing"
44

problems/2-keys-keyboard/2_keys_keyboard.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package p_2_keys_keyboard
1+
package problem_650
22

33
func minSteps(n int) int {
44
if n == 1 {

problems/2-keys-keyboard/2_keys_keyboard_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package p_2_keys_keyboard
1+
package problem_650
22

33
import "testing"
44

problems/24-game/24_game.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package p_24_game
1+
package problem_679
22

33
import "sort"
44

0 commit comments

Comments
 (0)