Skip to content

Update: PackageName #652

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 18, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions internal/leetcode/question_data.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"regexp"
"strconv"
"strings"
"unicode"
)

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

func (question *questionType) PackageName() string {
snake := question.TitleSnake()
if snake != "" && unicode.IsNumber(rune(snake[0])) {
snake = "p_" + snake
}
return snake
return "problem_" + question.QuestionFrontendId
}

func (question *questionType) SaveCodeSnippet() {
Expand Down
2 changes: 1 addition & 1 deletion problems/01-matrix/01_matrix.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_01_matrix
package problem_542

func updateMatrix(matrix [][]int) [][]int {
m, n := len(matrix), len(matrix[0])
Expand Down
2 changes: 1 addition & 1 deletion problems/01-matrix/01_matrix_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_01_matrix
package problem_542

import (
"reflect"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package p_1_bit_and_2_bit_characters
package problem_717

func isOneBitCharacter(bits []int) bool {
l := len(bits) - 1
i := 0
i, l := 0, len(bits)-1
for i < l {
i += bits[i] + 1
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_1_bit_and_2_bit_characters
package problem_717

import "testing"

Expand Down
2 changes: 1 addition & 1 deletion problems/132-pattern/132_pattern.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_132_pattern
package problem_456

func find132pattern(nums []int) bool {
ak, ajStack := -1<<31, make([]int, 0, len(nums))
Expand Down
2 changes: 1 addition & 1 deletion problems/132-pattern/132_pattern_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_132_pattern
package problem_456

import "testing"

Expand Down
2 changes: 1 addition & 1 deletion problems/2-keys-keyboard/2_keys_keyboard.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_2_keys_keyboard
package problem_650

func minSteps(n int) int {
if n == 1 {
Expand Down
2 changes: 1 addition & 1 deletion problems/2-keys-keyboard/2_keys_keyboard_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_2_keys_keyboard
package problem_650

import "testing"

Expand Down
2 changes: 1 addition & 1 deletion problems/24-game/24_game.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_24_game
package problem_679

import "sort"

Expand Down
2 changes: 1 addition & 1 deletion problems/24-game/24_game_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_24_game
package problem_679

import "testing"

Expand Down
2 changes: 1 addition & 1 deletion problems/3sum-closest/3sum_closest.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_3sum_closest
package problem_16

import (
"math"
Expand Down
2 changes: 1 addition & 1 deletion problems/3sum-closest/3sum_closest_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_3sum_closest
package problem_16

import "testing"

Expand Down
2 changes: 1 addition & 1 deletion problems/3sum-smaller/3sum_smaller.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package p_3sum_smaller
package problem_258
2 changes: 1 addition & 1 deletion problems/3sum-smaller/3sum_smaller_test.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package p_3sum_smaller
package problem_258
2 changes: 1 addition & 1 deletion problems/3sum-with-multiplicity/3sum_with_multiplicity.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package p_3sum_with_multiplicity
package problem_923
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package p_3sum_with_multiplicity
package problem_923
2 changes: 1 addition & 1 deletion problems/3sum/3sum.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_3sum
package problem_15

import "sort"

Expand Down
2 changes: 1 addition & 1 deletion problems/3sum/3sum_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_3sum
package problem_15

import (
"reflect"
Expand Down
2 changes: 1 addition & 1 deletion problems/4-keys-keyboard/4_keys_keyboard.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package p_4_keys_keyboard
package problem_651
2 changes: 1 addition & 1 deletion problems/4-keys-keyboard/4_keys_keyboard_test.go
Original file line number Diff line number Diff line change
@@ -1 +1 @@
package p_4_keys_keyboard
package problem_651
2 changes: 1 addition & 1 deletion problems/4sum-ii/4sum_ii.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_4sum_ii
package problem_454

func fourSumCount(A []int, B []int, C []int, D []int) int {
ans, n := 0, len(A)
Expand Down
2 changes: 1 addition & 1 deletion problems/4sum-ii/4sum_ii_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_4sum_ii
package problem_454

import "testing"

Expand Down
2 changes: 1 addition & 1 deletion problems/4sum/4sum.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_4sum
package problem_18

import "sort"

Expand Down
2 changes: 1 addition & 1 deletion problems/4sum/4sum_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package p_4sum
package problem_18

import (
"reflect"
Expand Down