Fix go report

This commit is contained in:
halfrost
2022-09-08 14:55:40 -07:00
parent 2a40f7cefb
commit e227edf55a
255 changed files with 273 additions and 280 deletions

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question145 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question147 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question148 struct {

View File

@ -1,9 +1,9 @@
package leetcode
import "fmt"
import (
"github.com/halfrost/LeetCode-Go/structures"
"fmt"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question160 struct {

View File

@ -3,7 +3,7 @@ package leetcode
import (
"container/heap"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
func Test_Problem173(t *testing.T) {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question199 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question203 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question206 struct {

View File

@ -3,7 +3,7 @@ package leetcode
import (
"sort"
"github.com/halfrost/LeetCode-Go/template"
"github.com/halfrost/leetcode-go/template"
)
// 解法一 树状数组,时间复杂度 O(n log n)

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question222 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question226 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question230 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question234 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question235 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question236 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question237 struct {

View File

@ -74,7 +74,7 @@ Output: [5,-99]
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -2,10 +2,8 @@ package leetcode
import (
"strconv"
)
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question257 struct {

View File

@ -4,7 +4,7 @@ import (
"strconv"
"strings"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type TreeNode = structures.TreeNode

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question297 struct {
@ -31,12 +31,12 @@ func Test_Problem297(t *testing.T) {
ans297{[]int{}},
},
{
para297{[]int{1,2,3,-1,-1,4,5}},
ans297{[]int{1,2,3,-1,-1,4,5}},
para297{[]int{1, 2, 3, -1, -1, 4, 5}},
ans297{[]int{1, 2, 3, -1, -1, 4, 5}},
},
{
para297{[]int{1,2}},
ans297{[]int{1,2}},
para297{[]int{1, 2}},
ans297{[]int{1, 2}},
},
}
@ -52,4 +52,4 @@ func Test_Problem297(t *testing.T) {
fmt.Printf("【output】:%v \n", structures.Tree2Preorder(tree297.deserialize(serialized)))
}
fmt.Printf("\n\n\n")
}
}

View File

@ -62,7 +62,7 @@ import (
"strconv"
"strings"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type TreeNode = structures.TreeNode

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/template"
"github.com/halfrost/leetcode-go/template"
)
//解法一 线段树sumRange 时间复杂度 O(1)

View File

@ -1,6 +1,6 @@
package leetcode
import "github.com/halfrost/LeetCode-Go/template"
import "github.com/halfrost/leetcode-go/template"
// NumArray define
type NumArray struct {

View File

@ -3,7 +3,7 @@ package leetcode
import (
"sort"
"github.com/halfrost/LeetCode-Go/template"
"github.com/halfrost/leetcode-go/template"
)
// 解法一 线段树

View File

@ -3,7 +3,7 @@ package leetcode
import (
"sort"
"github.com/halfrost/LeetCode-Go/template"
"github.com/halfrost/leetcode-go/template"
)
// 解法一 线段树,时间复杂度 O(n log n)

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question328 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question337 struct {

View File

@ -3,7 +3,7 @@ package leetcode
import (
"math/rand"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define
@ -20,8 +20,10 @@ type Solution struct {
head *ListNode
}
/** @param head The linked list's head.
Note that the head is guaranteed to be not null, so it contains at least one node. */
/*
- @param head The linked list's head.
Note that the head is guaranteed to be not null, so it contains at least one node.
*/
func Constructor(head *ListNode) Solution {
return Solution{head: head}
}

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
func Test_Problem382(t *testing.T) {

View File

@ -61,7 +61,7 @@ package leetcode
import (
"math/rand"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question404 struct {

View File

@ -3,7 +3,7 @@ package leetcode
import (
"sort"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// Interval define

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question437 struct {

View File

@ -53,7 +53,7 @@ Output: 3
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// ListNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question445 struct {

View File

@ -3,7 +3,7 @@ package leetcode
import (
"sort"
"github.com/halfrost/LeetCode-Go/template"
"github.com/halfrost/leetcode-go/template"
)
// 解法一 归并排序 mergesort时间复杂度 O(n log n)

View File

@ -2,10 +2,8 @@ package leetcode
import (
"sort"
)
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question508 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question513 struct {

View File

@ -3,10 +3,8 @@ package leetcode
import (
"math"
"sort"
)
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question515 struct {

View File

@ -3,7 +3,7 @@ package leetcode
import (
"math"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question530 struct {

View File

@ -45,7 +45,7 @@ package leetcode
import (
"math"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question538 struct {

View File

@ -70,7 +70,7 @@ Output: [7,9,4,10]
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question543 struct {

View File

@ -47,7 +47,7 @@ Output: 1
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/template"
"github.com/halfrost/leetcode-go/template"
)
// 解法一 并查集

View File

@ -1,9 +1,9 @@
package leetcode
import "math"
import (
"github.com/halfrost/LeetCode-Go/structures"
"math"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question563 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question572 struct {

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question589 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question617 struct {

View File

@ -50,7 +50,7 @@ Output: [2,2]
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question623 struct {

View File

@ -68,7 +68,7 @@ v = 1d = 3Output:
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question637 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question653 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question662 struct {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question669 struct {

View File

@ -68,7 +68,7 @@ Output: [2]
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/template"
"github.com/halfrost/leetcode-go/template"
)
func findRedundantConnection(edges [][]int) []int {

View File

@ -3,7 +3,7 @@ package leetcode
import (
"sort"
"github.com/halfrost/LeetCode-Go/template"
"github.com/halfrost/leetcode-go/template"
)
func fallingSquares(positions [][]int) []int {

View File

@ -1,7 +1,7 @@
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -42,7 +42,7 @@ Find the node in the BST that the node's value equals val and return the subtree
package leetcode
import (
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
// TreeNode define

View File

@ -1,6 +1,6 @@
package leetcode
import "github.com/halfrost/LeetCode-Go/structures"
import "github.com/halfrost/leetcode-go/structures"
// TreeNode define
type TreeNode = structures.TreeNode

View File

@ -4,7 +4,7 @@ import (
"fmt"
"testing"
"github.com/halfrost/LeetCode-Go/structures"
"github.com/halfrost/leetcode-go/structures"
)
type question701 struct {

View File

@ -57,7 +57,7 @@ Output: [4,2,7,1,3,5]
```go
package leetcode
import "github.com/halfrost/LeetCode-Go/structures"
import "github.com/halfrost/leetcode-go/structures"
// TreeNode define
type TreeNode = structures.TreeNode

Some files were not shown because too many files have changed in this diff Show More