a
This commit is contained in:
@@ -4,7 +4,6 @@ import (
|
||||
"bytes"
|
||||
"crypto/aes"
|
||||
"crypto/cipher"
|
||||
"crypto/sha1"
|
||||
"encoding/base64"
|
||||
"fmt"
|
||||
"math"
|
||||
@@ -219,31 +218,56 @@ func TestUpdateExpand(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestUploadImageNew(t *testing.T) {
|
||||
// accountsMerge([][]string{[]string{
|
||||
// "John", "johnsmith@mail.com", "john00@mail.com",
|
||||
// }, []string{
|
||||
// "John", "johnnybravo@mail.com",
|
||||
// }, []string{
|
||||
// "John", "johnsmith@mail.com", "john_newyork@mail.com",
|
||||
// }, []string{
|
||||
// "Mary", "mary@mail.com",
|
||||
// }})
|
||||
//bfde9c3c5df188541d1d47f17e03f8a75a872fe4
|
||||
fmt.Println(qwe())
|
||||
fmt.Println(spiralOrder([][]int{[]int{1, 2, 3, 4}, []int{5, 6, 7, 8}, []int{9, 10, 11, 12}}))
|
||||
}
|
||||
|
||||
func qwe() int {
|
||||
defer fmt.Println("1")
|
||||
a := 2
|
||||
if a == 1 {
|
||||
return 1
|
||||
//输入一个矩阵,按照从外向里以顺时针的顺序依次打印出每一个数字。
|
||||
func spiralOrder(matrix [][]int) []int {
|
||||
var result []int
|
||||
|
||||
l, h := len(matrix[0]), len(matrix)
|
||||
left, right, top, bottom := 0, l-1, 0, h-1
|
||||
lmax, tmax := 0, 0
|
||||
if l%2 == 0 {
|
||||
lmax = l / 2
|
||||
} else {
|
||||
lmax = l/2 + 1
|
||||
}
|
||||
if h%2 == 0 {
|
||||
tmax = l / 2
|
||||
} else {
|
||||
tmax = l/2 + 1
|
||||
}
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
func encryptPassword(password, salt string) string {
|
||||
return fmt.Sprintf("%x", sha1.Sum([]byte(password+salt)))
|
||||
for left <= lmax && top+1 <= tmax {
|
||||
for left1 := left; left1 <= right; left1++ {
|
||||
result = append(result, matrix[top][left1])
|
||||
}
|
||||
fmt.Println(result, 1)
|
||||
if h > 1 {
|
||||
for top1 := top + 1; top1 <= bottom; top1++ {
|
||||
result = append(result, matrix[top1][right])
|
||||
}
|
||||
fmt.Println(result, 2)
|
||||
if right > 0 {
|
||||
for right1 := right - 1; right1 >= left; right1-- {
|
||||
result = append(result, matrix[bottom][right1])
|
||||
}
|
||||
}
|
||||
fmt.Println(result, 3)
|
||||
if bottom > 0 {
|
||||
for bottom1 := bottom - 1; bottom1 >= top+1; bottom1-- {
|
||||
result = append(result, matrix[bottom1][left])
|
||||
}
|
||||
}
|
||||
fmt.Println(result, 4)
|
||||
}
|
||||
left++
|
||||
top++
|
||||
right--
|
||||
bottom--
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
func addToArrayForm(A []int, K int) (a []int) {
|
||||
|
||||
Reference in New Issue
Block a user