-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
58 lines (50 loc) · 792 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package main
import (
"fmt"
nornal "github.com/biuboombiuboom/leetcode/nornal/algorithm"
nTypes "github.com/biuboombiuboom/leetcode/nornal/types"
)
func main() {
n5 := &nornal.ListNode{
Val: 5,
}
n4 := &nornal.ListNode{
Val: 4,
Next: n5,
}
n3 := &nornal.ListNode{
Val: 3,
Next: n4,
}
n2 := &nornal.ListNode{
Val: 2,
Next: n3,
}
head := &nornal.ListNode{
Val: 1,
Next: n2,
}
l := nornal.SwapPairs(head)
println(l.Val)
n := l.Next
for n != nil {
fmt.Println(n.Val)
n = n.Next
}
return
l1 := &nTypes.ListNode{
Val: 2,
Next: &nTypes.ListNode{
Val: 4,
Next: nil,
},
}
println(l1.Val)
next := l1.Next
for next != nil {
fmt.Println(next.Val)
next = next.Next
}
return
fmt.Println(nornal.Convert("LEETCODEISHIRING", 3))
}