mirror of
https://github.com/halfrost/LeetCode-Go.git
synced 2025-07-05 00:25:22 +08:00
optimization code level from A to A+
This commit is contained in:
@ -5,10 +5,10 @@ import (
|
||||
)
|
||||
|
||||
var dir = [][]int{
|
||||
[]int{-1, 0},
|
||||
[]int{0, 1},
|
||||
[]int{1, 0},
|
||||
[]int{0, -1},
|
||||
{-1, 0},
|
||||
{0, 1},
|
||||
{1, 0},
|
||||
{0, -1},
|
||||
}
|
||||
|
||||
func longestIncreasingPath(matrix [][]int) int {
|
||||
|
@ -26,33 +26,33 @@ func Test_Problem329(t *testing.T) {
|
||||
|
||||
qs := []question329{
|
||||
|
||||
question329{
|
||||
para329{[][]int{[]int{1}}},
|
||||
{
|
||||
para329{[][]int{{1}}},
|
||||
ans329{1},
|
||||
},
|
||||
|
||||
question329{
|
||||
para329{[][]int{[]int{}}},
|
||||
{
|
||||
para329{[][]int{{}}},
|
||||
ans329{0},
|
||||
},
|
||||
|
||||
question329{
|
||||
para329{[][]int{[]int{9, 9, 4}, []int{6, 6, 8}, []int{2, 1, 1}}},
|
||||
{
|
||||
para329{[][]int{{9, 9, 4}, {6, 6, 8}, {2, 1, 1}}},
|
||||
ans329{4},
|
||||
},
|
||||
|
||||
question329{
|
||||
para329{[][]int{[]int{3, 4, 5}, []int{3, 2, 6}, []int{2, 2, 1}}},
|
||||
{
|
||||
para329{[][]int{{3, 4, 5}, {3, 2, 6}, {2, 2, 1}}},
|
||||
ans329{4},
|
||||
},
|
||||
|
||||
question329{
|
||||
para329{[][]int{[]int{1, 5, 9}, []int{10, 11, 13}, []int{12, 13, 15}}},
|
||||
{
|
||||
para329{[][]int{{1, 5, 9}, {10, 11, 13}, {12, 13, 15}}},
|
||||
ans329{5},
|
||||
},
|
||||
|
||||
question329{
|
||||
para329{[][]int{[]int{1, 5, 7}, []int{11, 12, 13}, []int{12, 13, 15}}},
|
||||
{
|
||||
para329{[][]int{{1, 5, 7}, {11, 12, 13}, {12, 13, 15}}},
|
||||
ans329{5},
|
||||
},
|
||||
}
|
||||
|
Reference in New Issue
Block a user