2022-05-22 15:54:36 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
. "github.com/ehlxr/leetcode-go/src"
|
|
|
|
)
|
|
|
|
|
|
|
|
func main() {
|
2022-06-04 06:34:28 +00:00
|
|
|
// node5 := &ListNode{Val: 5, Next: nil}
|
|
|
|
// node4 := &ListNode{Val: 4, Next: node5}
|
|
|
|
// node3 := &ListNode{Val: 3, Next: node4}
|
|
|
|
// node2 := &ListNode{Val: 2, Next: node3}
|
|
|
|
// node1 := &ListNode{Val: 1, Next: node2}
|
|
|
|
// root := &ListNode{Val: 0, Next: node1}
|
|
|
|
// fmt.Printf("%v\n", root)
|
|
|
|
//
|
2022-05-22 15:54:36 +00:00
|
|
|
// fmt.Printf("%v\n", Reverse(root))
|
2022-06-04 06:34:28 +00:00
|
|
|
// fmt.Printf("%v\n", ReverseRec(root))
|
2022-05-23 08:43:38 +00:00
|
|
|
// fmt.Printf("%v\n", ReverseKGroup(root, 2))
|
2022-06-04 06:34:28 +00:00
|
|
|
|
|
|
|
// s := "Hello 你好"
|
|
|
|
// println(s[2], s[6])
|
|
|
|
// rs := []rune(s)
|
|
|
|
// println(string(rs[6]))
|
|
|
|
|
|
|
|
s := "babad"
|
|
|
|
println(LongestPalindrome(s))
|
|
|
|
|
2022-05-22 15:54:36 +00:00
|
|
|
}
|