Skip to content

Commit dff1d84

Browse files
committed
Up goreport score
1 parent e227edf commit dff1d84

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

leetcode/0842.Split-Array-into-Fibonacci-Sequence/842. Split Array into Fibonacci Sequence.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ func splitIntoFibonacci(S string) []int {
3232
return res
3333
}
3434

35-
//Propagate for rest of the string
35+
// Propagate for rest of the string
3636
func findRecursiveCheck(S string, x1 int, x2 int, left int, res *[]int, isComplete *bool) {
3737
if x1 >= 1<<31 || x2 >= 1<<31 { // 题目要求每个数都要小于 2^31 - 1 = 2147483647,此处剪枝很关键!
3838
return

leetcode/1178.Number-of-Valid-Words-for-Each-Puzzle/1178. Number of Valid Words for Each Puzzle.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package leetcode
22

33
/*
4-
匹配跟单词中的字母顺序,字母个数都无关,可以用 bitmap 压缩
5-
1. 记录 word 中 利用 map 记录各种 bit 标示的个数
6-
2. puzzles 中各个字母都不相同! 记录 bitmap,然后搜索子空间中各种 bit 标识的个数的和
7-
因为 puzzles 长度最长是7,所以搜索空间 2^7
4+
匹配跟单词中的字母顺序,字母个数都无关,可以用 bitmap 压缩
5+
1. 记录 word 中 利用 map 记录各种 bit 标示的个数
6+
2. puzzles 中各个字母都不相同! 记录 bitmap,然后搜索子空间中各种 bit 标识的个数的和
7+
因为 puzzles 长度最长是7,所以搜索空间 2^7
88
*/
99
func findNumOfValidWords(words []string, puzzles []string) []int {
1010
wordBitStatusMap, res := make(map[uint32]int, 0), []int{}
@@ -29,7 +29,7 @@ func toBitMap(word []byte) uint32 {
2929
return res
3030
}
3131

32-
//利用 dfs 搜索 puzzles 的子空间
32+
// 利用 dfs 搜索 puzzles 的子空间
3333
func findNum(puzzles []byte, bitMap uint32, totalNum *int, m map[uint32]int) {
3434
if len(puzzles) == 0 {
3535
*totalNum = *totalNum + m[bitMap]

leetcode/1685.Sum-of-Absolute-Differences-in-a-Sorted-Array/1685. Sum of Absolute Differences in a Sorted Array.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package leetcode
22

3-
//解法一 优化版 prefixSum + sufixSum
3+
// 解法一 优化版 prefixSum + sufixSum
44
func getSumAbsoluteDifferences(nums []int) []int {
55
size := len(nums)
66
sufixSum := make([]int, size)

leetcode/1725.Number-Of-Rectangles-That-Can-Form-The-Largest-Square/1725. Number Of Rectangles That Can Form The Largest Square.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ package leetcode
22

33
func countGoodRectangles(rectangles [][]int) int {
44
minLength, count := 0, 0
5-
for i, _ := range rectangles {
5+
for i := range rectangles {
66
minSide := 0
77
if rectangles[i][0] <= rectangles[i][1] {
88
minSide = rectangles[i][0]

0 commit comments

Comments
 (0)