Merge pull request #98 from halfrost/collapsed_menu

[Breaking Change] Collapsed menu #55
This commit is contained in:
halfrost
2021-02-07 15:50:24 +08:00
committed by YDZ
695 changed files with 3758 additions and 4745 deletions

2348
README.md

File diff suppressed because it is too large Load Diff

View File

@ -74,12 +74,12 @@ var (
}
)
func getChapterFourFileOrder() []string {
solutions := util.LoadChapterFourDir()
func getChapterFourFileOrder() ([]string, []int) {
solutions, solutionIds := util.LoadChapterFourDir()
chapterFourFileOrder := []string{"_index"}
chapterFourFileOrder = append(chapterFourFileOrder, solutions...)
fmt.Printf("ChapterFour 中包括 _index 有 %v 个文件\n", len(chapterFourFileOrder))
return chapterFourFileOrder
fmt.Printf("ChapterFour 中包括 _index 有 %v 个文件, len(id) = %v\n", len(chapterFourFileOrder), len(solutionIds))
return chapterFourFileOrder, solutionIds
}
func newLabelCommand() *cobra.Command {
@ -123,57 +123,75 @@ func newDeletePreNext() *cobra.Command {
func addPreNext() {
// Chpater one add pre-next
addPreNextLabel(chapterOneFileOrder, []string{}, "", "ChapterOne", "ChapterTwo")
addPreNextLabel(chapterOneFileOrder, []string{}, []int{}, "", "ChapterOne", "ChapterTwo")
// Chpater two add pre-next
addPreNextLabel(chapterTwoFileOrder, chapterOneFileOrder, "ChapterOne", "ChapterTwo", "ChapterThree")
addPreNextLabel(chapterTwoFileOrder, chapterOneFileOrder, []int{}, "ChapterOne", "ChapterTwo", "ChapterThree")
// Chpater three add pre-next
addPreNextLabel(chapterThreeFileOrder, chapterTwoFileOrder, "ChapterTwo", "ChapterThree", "ChapterFour")
addPreNextLabel(chapterThreeFileOrder, chapterTwoFileOrder, []int{}, "ChapterTwo", "ChapterThree", "ChapterFour")
// Chpater four add pre-next
//fmt.Printf("%v\n", getChapterFourFileOrder())
addPreNextLabel(getChapterFourFileOrder(), chapterThreeFileOrder, "ChapterThree", "ChapterFour", "")
chapterFourFileOrder, solutionIds := getChapterFourFileOrder()
addPreNextLabel(chapterFourFileOrder, chapterThreeFileOrder, solutionIds, "ChapterThree", "ChapterFour", "")
}
func addPreNextLabel(order, preOrder []string, preChapter, chapter, nextChapter string) {
func addPreNextLabel(order, preOrder []string, chapterFourIds []int, preChapter, chapter, nextChapter string) {
var (
exist bool
err error
res []byte
count int
)
for index, v := range order {
for index, path := range order {
tmp := ""
if index == 0 {
if chapter == "ChapterOne" {
// 第一页不需要“上一章”
tmp = "\n\n" + delLine + fmt.Sprintf("<p align = \"right\"><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">下一页➡️</a></p>\n", chapter, order[index+1])
} else {
tmp = "\n\n" + preNextHeader + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">⬅️上一章</a></p>\n", preChapter, preOrder[len(preOrder)-1]) + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">下一页➡️</a></p>\n", chapter, order[index+1]) + preNextFotter
if chapter == "ChapterFour" {
tmp = "\n\n" + preNextHeader + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">⬅️上一章</a></p>\n", preChapter, preOrder[len(preOrder)-1]) + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/%v/\">下一页➡️</a></p>\n", chapter, util.GetChpaterFourFileNum(chapterFourIds[(index-1)+1]), order[index+1]) + preNextFotter
} else {
tmp = "\n\n" + preNextHeader + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">⬅️上一章</a></p>\n", preChapter, preOrder[len(preOrder)-1]) + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">下一页➡️</a></p>\n", chapter, order[index+1]) + preNextFotter
}
}
} else if index == len(order)-1 {
if chapter == "ChapterFour" {
// 最后一页不需要“下一页”
tmp = "\n\n" + delLine + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">⬅️上一页</a></p>\n", chapter, order[index-1])
tmp = "\n\n" + delLine + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/%v/\">⬅️上一页</a></p>\n", chapter, util.GetChpaterFourFileNum(chapterFourIds[(index-1)-1]), order[index-1])
} else {
tmp = "\n\n" + preNextHeader + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">⬅️上一页</a></p>\n", chapter, order[index-1]) + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/\">下一章➡️</a></p>\n", nextChapter) + preNextFotter
}
} else if index == 1 {
tmp = "\n\n" + preNextHeader + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/\">⬅️上一页</a></p>\n", chapter) + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">下一页➡️</a></p>\n", chapter, order[index+1]) + preNextFotter
if chapter == "ChapterFour" {
tmp = "\n\n" + preNextHeader + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/\">⬅️上一页</a></p>\n", chapter) + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/%v/\">下一页➡️</a></p>\n", chapter, util.GetChpaterFourFileNum(chapterFourIds[(index-1)+1]), order[index+1]) + preNextFotter
} else {
tmp = "\n\n" + preNextHeader + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/\">⬅️上一页</a></p>\n", chapter) + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">下一页➡️</a></p>\n", chapter, order[index+1]) + preNextFotter
}
} else {
tmp = "\n\n" + preNextHeader + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">⬅️上一页</a></p>\n", chapter, order[index-1]) + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">下一页➡️</a></p>\n", chapter, order[index+1]) + preNextFotter
if chapter == "ChapterFour" {
tmp = "\n\n" + preNextHeader + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/%v/\">⬅️上一页</a></p>\n", chapter, util.GetChpaterFourFileNum(chapterFourIds[(index-1)-1]), order[index-1]) + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/%v/\">下一页➡️</a></p>\n", chapter, util.GetChpaterFourFileNum(chapterFourIds[(index-1)+1]), order[index+1]) + preNextFotter
} else {
tmp = "\n\n" + preNextHeader + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">⬅️上一页</a></p>\n", chapter, order[index-1]) + fmt.Sprintf("<p><a href=\"https://books.halfrost.com/leetcode/%v/%v/\">下一页➡️</a></p>\n", chapter, order[index+1]) + preNextFotter
}
}
exist, err = needAdd(fmt.Sprintf("../website/content/%v/%v.md", chapter, v))
if chapter == "ChapterFour" && index > 0 {
path = fmt.Sprintf("%v/%v", util.GetChpaterFourFileNum(chapterFourIds[(index-1)]), path)
}
exist, err = needAdd(fmt.Sprintf("../website/content/%v/%v.md", chapter, path))
if err != nil {
fmt.Println(err)
return
}
// 当前没有上一页和下一页,才添加
if !exist && err == nil {
res, err = eofAdd(fmt.Sprintf("../website/content/%v/%v.md", chapter, v), tmp)
res, err = eofAdd(fmt.Sprintf("../website/content/%v/%v.md", chapter, path), tmp)
if err != nil {
fmt.Println(err)
return
}
util.WriteFile(fmt.Sprintf("../website/content/%v/%v.md", chapter, v), res)
util.WriteFile(fmt.Sprintf("../website/content/%v/%v.md", chapter, path), res)
count++
}
}
@ -205,30 +223,35 @@ func eofAdd(filePath string, labelString string) ([]byte, error) {
func delPreNext() {
// Chpater one del pre-next
delPreNextLabel(chapterOneFileOrder, "ChapterOne")
delPreNextLabel(chapterOneFileOrder, []int{}, "ChapterOne")
// Chpater two del pre-next
delPreNextLabel(chapterTwoFileOrder, "ChapterTwo")
delPreNextLabel(chapterTwoFileOrder, []int{}, "ChapterTwo")
// Chpater three del pre-next
delPreNextLabel(chapterThreeFileOrder, "ChapterThree")
delPreNextLabel(chapterThreeFileOrder, []int{}, "ChapterThree")
// Chpater four del pre-next
delPreNextLabel(getChapterFourFileOrder(), "ChapterFour")
chapterFourFileOrder, solutionIds := getChapterFourFileOrder()
delPreNextLabel(chapterFourFileOrder, solutionIds, "ChapterFour")
}
func delPreNextLabel(order []string, chapter string) {
func delPreNextLabel(order []string, chapterFourIds []int, chapter string) {
count := 0
for index, v := range order {
for index, path := range order {
lineNum := 5
if index == 0 && chapter == "ChapterOne" || index == len(order)-1 && chapter == "ChapterFour" {
lineNum = 3
}
exist, err := needAdd(fmt.Sprintf("../website/content/%v/%v.md", chapter, v))
if chapter == "ChapterFour" && index > 0 {
path = fmt.Sprintf("%v/%v", util.GetChpaterFourFileNum(chapterFourIds[(index-1)]), path)
}
exist, err := needAdd(fmt.Sprintf("../website/content/%v/%v.md", chapter, path))
if err != nil {
fmt.Println(err)
return
}
// 存在才删除
if exist && err == nil {
removeLine(fmt.Sprintf("../website/content/%v/%v.md", chapter, v), lineNum+1)
removeLine(fmt.Sprintf("../website/content/%v/%v.md", chapter, path), lineNum+1)
count++
}
}

View File

@ -130,9 +130,9 @@ func GenerateTagMdRows(solutionIds []int, metaMap map[int]TagList, mdrows []Mdro
s6 := strings.Replace(s5, ",", "", -1)
s7 := strings.Replace(s6, "?", "", -1)
if internal {
tmp.SolutionPath = fmt.Sprintf("[Go]({{< relref \"/ChapterFour/%v.md\" >}})", fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), s7))
tmp.SolutionPath = fmt.Sprintf("[Go]({{< relref \"/ChapterFour/%v/%v.md\" >}})", util.GetChpaterFourFileNum(int(row.FrontendQuestionID)), fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), s7))
} else {
tmp.SolutionPath = fmt.Sprintf("[Go](https://books.halfrost.com/leetcode/ChapterFour/%v)", fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), s7))
tmp.SolutionPath = fmt.Sprintf("[Go](https://books.halfrost.com/leetcode/ChapterFour/%v/%v)", util.GetChpaterFourFileNum(int(row.FrontendQuestionID)), fmt.Sprintf("%04d.%v", int(row.FrontendQuestionID), s7))
}
tmp.Acceptance = row.Acceptance
tmp.Difficulty = row.Difficulty

View File

@ -9,6 +9,7 @@ import (
"io/ioutil"
"os"
"regexp"
"strconv"
"strings"
)
@ -59,7 +60,7 @@ func generatePDF() {
// 先删除 pre-next
delPreNext()
chapterFourFileOrder := util.LoadChapterFourDir()
chapterFourFileOrder, _ := util.LoadChapterFourDir()
totalSolutions = len(chapterFourFileOrder)
midVersion = totalSolutions / 100
lastVersion = totalSolutions % 100
@ -102,7 +103,17 @@ func loadChapter(order []string, path, chapter string) ([]byte, error) {
// 清理不支持的特殊 MarkDown 语法
tmp, err = clean(fmt.Sprintf("%v/%v/%v.md", path, chapter, v))
} else {
tmp, err = util.LoadFile(fmt.Sprintf("%v/%v/%v.md", path, chapter, v))
if chapter == "ChapterFour" {
if v[4] == '.' {
num, err := strconv.Atoi(v[:4])
if err != nil {
fmt.Println(err)
}
tmp, err = util.LoadFile(fmt.Sprintf("%v/%v/%v/%v.md", path, chapter, util.GetChpaterFourFileNum(num), v))
}
} else {
tmp, err = util.LoadFile(fmt.Sprintf("%v/%v/%v.md", path, chapter, v))
}
}
if err != nil {
fmt.Println(err)
@ -126,7 +137,7 @@ func prepare(path string) {
fmt.Println(err)
}
for _, v := range chapterOneFileOrder {
removeHeader(fmt.Sprintf("../website/content/ChapterOne/%v.md", v), fmt.Sprintf("./pdftemp/ChapterOne/%v.md", v), 4)
removeHeader(fmt.Sprintf("../website/content/ChapterOne/%v.md", v), fmt.Sprintf("./pdftemp/ChapterOne/%v.md", v), 5)
}
err = os.MkdirAll("./pdftemp/ChapterTwo", os.ModePerm)
@ -138,7 +149,7 @@ func prepare(path string) {
util.CopyFile("./pdftemp/ChapterTwo/_index.md", "../website/content/ChapterTwo/_index.md")
for _, v := range chapterTwoFileOrder {
removeHeader(fmt.Sprintf("./pdftemp/ChapterTwo/%v.md", v), fmt.Sprintf("./pdftemp/ChapterTwo/%v.md", v), 4)
removeHeader(fmt.Sprintf("./pdftemp/ChapterTwo/%v.md", v), fmt.Sprintf("./pdftemp/ChapterTwo/%v.md", v), 5)
}
err = os.MkdirAll("./pdftemp/ChapterThree", os.ModePerm)
@ -146,14 +157,14 @@ func prepare(path string) {
fmt.Println(err)
}
for _, v := range chapterThreeFileOrder {
removeHeader(fmt.Sprintf("../website/content/ChapterThree/%v.md", v), fmt.Sprintf("./pdftemp/ChapterThree/%v.md", v), 4)
removeHeader(fmt.Sprintf("../website/content/ChapterThree/%v.md", v), fmt.Sprintf("./pdftemp/ChapterThree/%v.md", v), 5)
}
err = os.MkdirAll("./pdftemp/ChapterFour", os.ModePerm)
if err != nil {
fmt.Println(err)
}
removeHeader(fmt.Sprintf("../website/content/ChapterFour/_index.md"), fmt.Sprintf("./pdftemp/ChapterFour/_index.md"), 4)
removeHeader(fmt.Sprintf("../website/content/ChapterFour/_index.md"), fmt.Sprintf("./pdftemp/ChapterFour/_index.md"), 5)
}
func clean(filePath string) ([]byte, error) {

View File

@ -18,7 +18,8 @@ func newRefresh() *cobra.Command {
}
func refresh() {
buildBookMenu()
//buildBookMenu()
copyLackFile()
delPreNext()
buildREADME()
buildChapterTwo(true)

View File

@ -4,15 +4,16 @@ import (
"bufio"
"encoding/json"
"fmt"
m "github.com/halfrost/LeetCode-Go/ctl/models"
"github.com/halfrost/LeetCode-Go/ctl/util"
"github.com/spf13/cobra"
"io"
"os"
"regexp"
"sort"
"strconv"
"strings"
m "github.com/halfrost/LeetCode-Go/ctl/models"
"github.com/halfrost/LeetCode-Go/ctl/util"
"github.com/spf13/cobra"
)
var (
@ -33,7 +34,7 @@ func newBuildCommand() *cobra.Command {
mc.AddCommand(
newBuildREADME(),
newBuildChapterTwo(),
newBuildMenu(),
// newBuildMenu(),
)
return mc
}
@ -263,24 +264,7 @@ func renderChapterTwo(filePath string, tls m.TagLists) ([]byte, error) {
}
func buildBookMenu() {
solutionIds, soName, _ := util.LoadSolutionsDir()
ch4Ids, _ := util.LoadChapterFourIds()
needCopy := []string{}
for i := 0; i < len(solutionIds); i++ {
if util.BinarySearch(ch4Ids, solutionIds[i]) == -1 {
needCopy = append(needCopy, soName[i])
}
}
if len(needCopy) > 0 {
fmt.Printf("有 %v 道题需要拷贝到第四章中\n", len(needCopy))
for i := 0; i < len(needCopy); i++ {
util.CopyFile(fmt.Sprintf("../website/content/ChapterFour/%v.md", needCopy[i]), fmt.Sprintf("../leetcode/%v/README.md", needCopy[i]))
}
} else {
fmt.Printf("【第四章没有需要添加的题解,已经完整了】\n")
}
copyLackFile()
// 按照模板重新渲染 Menu
res, err := renderBookMenu("./template/menu.md")
if err != nil {
@ -291,12 +275,45 @@ func buildBookMenu() {
fmt.Println("generate Menu successful")
}
// 拷贝 leetcode 目录下的题解 README 文件至第四章对应文件夹中
func copyLackFile() {
solutionIds, soName, _ := util.LoadSolutionsDir()
_, ch4Ids := util.LoadChapterFourDir()
needCopy := []string{}
for i := 0; i < len(solutionIds); i++ {
if util.BinarySearch(ch4Ids, solutionIds[i]) == -1 {
needCopy = append(needCopy, soName[i])
}
}
if len(needCopy) > 0 {
fmt.Printf("有 %v 道题需要拷贝到第四章中\n", len(needCopy))
for i := 0; i < len(needCopy); i++ {
if needCopy[i][4] == '.' {
tmp, err := strconv.Atoi(needCopy[i][:4])
if err != nil {
fmt.Println(err)
}
err = os.MkdirAll(fmt.Sprintf("../website/content/ChapterFour/%v", util.GetChpaterFourFileNum(tmp)), os.ModePerm)
if err != nil {
fmt.Println(err)
}
util.CopyFile(fmt.Sprintf("../website/content/ChapterFour/%v/%v.md", util.GetChpaterFourFileNum(tmp), needCopy[i]), fmt.Sprintf("../leetcode/%v/README.md", needCopy[i]))
util.CopyFile(fmt.Sprintf("../website/content/ChapterFour/%v/_index.md", util.GetChpaterFourFileNum(tmp)), "./template/collapseSection.md")
}
}
} else {
fmt.Printf("【第四章没有需要添加的题解,已经完整了】\n")
}
}
func generateMenu() string {
res := ""
res += menuLine(chapterOneMenuOrder, "ChapterOne")
res += menuLine(chapterTwoFileOrder, "ChapterTwo")
res += menuLine(chapterThreeFileOrder, "ChapterThree")
res += menuLine(getChapterFourFileOrder(), "ChapterFour")
chapterFourFileOrder, _ := getChapterFourFileOrder()
res += menuLine(chapterFourFileOrder, "ChapterFour")
return res
}

View File

@ -1,6 +1,7 @@
---
title: Array
title: 2.01 Array
type: docs
weight: 1
---
# Array

View File

@ -1,6 +1,7 @@
---
title: Backtracking
title: 2.08 ✅ Backtracking
type: docs
weight: 8
---
# Backtracking

View File

@ -1,6 +1,7 @@
---
title: Binary Indexed Tree
title: 2.19 ✅ Binary Indexed Tree
type: docs
weight: 19
---
# Binary Indexed Tree

View File

@ -1,6 +1,7 @@
---
title: Binary Search
title: 2.11 Binary Search
type: docs
weight: 11
---
# Binary Search

View File

@ -1,6 +1,7 @@
---
title: Bit Manipulation
title: 2.15 ✅ Bit Manipulation
type: docs
weight: 15
---
# Bit Manipulation

View File

@ -1,6 +1,7 @@
---
title: Breadth First Search
title: 2.10 Breadth First Search
type: docs
weight: 10
---
# Breadth First Search

View File

@ -1,6 +1,7 @@
---
title: Depth First Search
title: 2.09 Depth First Search
type: docs
weight: 9
---
# Depth First Search

View File

@ -1,6 +1,7 @@
---
title: Dynamic Programming
title: 2.07 Dynamic Programming
type: docs
weight: 7
---
# Dynamic Programming

View File

@ -1,6 +1,7 @@
---
title: Hash Table
title: 2.13 Hash Table
type: docs
weight: 13
---
# Hash Table

View File

@ -1,6 +1,7 @@
---
title: Linked List
title: 2.04 ✅ Linked List
type: docs
weight: 4
---
# Linked List

View File

@ -1,6 +1,7 @@
---
title: Math
title: 2.12 Math
type: docs
weight: 12
---
# Math

View File

@ -1,6 +1,7 @@
---
title: Segment Tree
title: 2.18 ✅ Segment Tree
type: docs
weight: 18
---
# Segment Tree

View File

@ -1,6 +1,7 @@
---
title: Sliding Window
title: 2.17 ✅ Sliding Window
type: docs
weight: 17
---
# Sliding Window

View File

@ -1,6 +1,7 @@
---
title: Sort
title: 2.14 ✅ Sort
type: docs
weight: 14
---
# Sort

View File

@ -1,6 +1,7 @@
---
title: Stack
title: 2.05 ✅ Stack
type: docs
weight: 5
---
# Stack

View File

@ -1,6 +1,7 @@
---
title: String
title: 2.02 String
type: docs
weight: 2
---
# String

View File

@ -1,6 +1,7 @@
---
title: Tree
title: 2.06 Tree
type: docs
weight: 6
---
# Tree

View File

@ -1,6 +1,7 @@
---
title: Two Pointers
title: 2.03 ✅ Two Pointers
type: docs
weight: 3
---
# Two Pointers

View File

@ -1,6 +1,7 @@
---
title: Union Find
title: 2.16 ✅ Union Find
type: docs
weight: 16
---
# Union Find

View File

@ -0,0 +1,4 @@
---
bookCollapseSection: true
weight: 20
---

View File

@ -19,13 +19,6 @@ func LoadSolutionsDir() ([]int, []string, int) {
return solutionIds, soNames, total - len(solutionIds)
}
// LoadChapterFourIds define
func LoadChapterFourIds() ([]int, []string) {
solutionIds, soNames, _ := loadFile("../website/content/ChapterFour/")
fmt.Printf("读取了第四章 %v 道题的题解\n", len(solutionIds))
return solutionIds, soNames
}
func loadFile(path string) ([]int, []string, int) {
files, err := ioutil.ReadDir(path)
if err != nil {
@ -51,22 +44,38 @@ func loadFile(path string) ([]int, []string, int) {
return solutionIds, soNames, len(files)
}
// GetAllFile define
func GetAllFile(pathname string, fileList *[]string) ([]string, error) {
rd, err := ioutil.ReadDir(pathname)
for _, fi := range rd {
if fi.IsDir() {
//fmt.Printf("[%s]\n", pathname+"\\"+fi.Name())
GetAllFile(pathname+fi.Name()+"/", fileList)
} else {
//fmt.Println(fi.Name())
*fileList = append(*fileList, fi.Name())
}
}
return *fileList, err
}
// LoadChapterFourDir define
func LoadChapterFourDir() []string {
files, err := ioutil.ReadDir("../website/content/ChapterFour/")
func LoadChapterFourDir() ([]string, []int) {
files, err := GetAllFile("../website/content/ChapterFour/", &[]string{})
// files, err := ioutil.ReadDir("../website/content/ChapterFour/")
if err != nil {
fmt.Println(err)
}
solutions, solutionIds, solutionsMap := []string{}, []int{}, map[int]string{}
for _, f := range files {
if f.Name()[4] == '.' {
tmp, err := strconv.Atoi(f.Name()[:4])
if f[4] == '.' {
tmp, err := strconv.Atoi(f[:4])
if err != nil {
fmt.Println(err)
}
solutionIds = append(solutionIds, tmp)
// len(f.Name())-3 = 文件名去掉 .md 后缀
solutionsMap[tmp] = f.Name()[:len(f.Name())-3]
solutionsMap[tmp] = f[:len(f)-3]
}
}
sort.Ints(solutionIds)
@ -76,7 +85,7 @@ func LoadChapterFourDir() []string {
solutions = append(solutions, name)
}
}
return solutions
return solutions, solutionIds
}
// WriteFile define
@ -166,3 +175,11 @@ func BinarySearch(nums []int, target int) int {
}
return -1
}
// GetChpaterFourFileNum define
func GetChpaterFourFileNum(num int) string {
if num < 100 {
return fmt.Sprintf("%04d~%04d", (num/100)*100+1, (num/100)*100+99)
}
return fmt.Sprintf("%04d~%04d", (num/100)*100, (num/100)*100+99)
}

View File

@ -73,6 +73,10 @@ disablePathToLower = true
# weight = 30
[params]
# (Optional, default light) Sets color theme: light, dark or auto.
# Theme 'auto' switches between dark and light modes based on browser/os preferences
BookTheme = 'light'
# (Optional, default true) Controls table of contents visibility on right side of pages.
# Start and end levels can be controlled with markup.tableOfContents setting.
# You can also specify this parameter per page in front matter.
@ -84,11 +88,11 @@ disablePathToLower = true
# (Optional, default none) Set leaf bundle to render as side menu
# When not specified file structure and weights will be used
BookMenuBundle = '/menu'
# BookMenuBundle = '/menu'
# (Optional, default docs) Specify section of content to render as menu
# You can also set value to '*' to render all sections to menu
BookSection = 'docs'
BookSection = '*'
# Set source repository location.
# Used for 'Last Modified' and 'Edit this page' links.
@ -126,6 +130,10 @@ disablePathToLower = true
# (Optional, experimental, default false) Enables service worker that caches visited pages and resources for offline use.
BookServiceWorker = true
# /!\ This is an experimental feature, might be removed or changed at any time
# (Optional, experimental, default false) Enables a drop-down menu for translations only if a translation is present.
BookTranslatedOnly = false
[params.gitalk]
clientID = "75d9d747f200c623a0e6" # Your client ID
clientSecret = "e3cc2ff8d8f6ae3c894a827f226188de0d26f37e" # Your client secret

View File

@ -53,5 +53,5 @@ func twoSum(nums []int, target int) []int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0002.Add-Two-Numbers/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0002.Add-Two-Numbers/">下一页➡️</a></p>
</div>

View File

@ -80,6 +80,6 @@ func addTwoNumbers(l1 *ListNode, l2 *ListNode) *ListNode {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001.Two-Sum/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0001.Two-Sum/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters/">下一页➡️</a></p>
</div>

View File

@ -126,6 +126,6 @@ func max(a int, b int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0002.Add-Two-Numbers/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0004.Median-of-Two-Sorted-Arrays/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0002.Add-Two-Numbers/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0004.Median-of-Two-Sorted-Arrays/">下一页➡️</a></p>
</div>

View File

@ -100,6 +100,6 @@ func findMedianSortedArrays(nums1 []int, nums2 []int) float64 {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0003.Longest-Substring-Without-Repeating-Characters/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0007.Reverse-Integer/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0003.Longest-Substring-Without-Repeating-Characters/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0007.Reverse-Integer/">下一页➡️</a></p>
</div>

View File

@ -57,6 +57,6 @@ func reverse7(x int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0004.Median-of-Two-Sorted-Arrays/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0009.Palindrome-Number/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0004.Median-of-Two-Sorted-Arrays/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0009.Palindrome-Number/">下一页➡️</a></p>
</div>

View File

@ -71,6 +71,6 @@ func isPalindrome(x int) bool {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0007.Reverse-Integer/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0011.Container-With-Most-Water/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0007.Reverse-Integer/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0011.Container-With-Most-Water/">下一页➡️</a></p>
</div>

View File

@ -61,6 +61,6 @@ func maxArea(height []int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0009.Palindrome-Number/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0013.Roman-to-Integer/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0009.Palindrome-Number/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0013.Roman-to-Integer/">下一页➡️</a></p>
</div>

View File

@ -134,6 +134,6 @@ func romanToInt(s string) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0011.Container-With-Most-Water/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0015.3Sum/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0011.Container-With-Most-Water/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0015.3Sum/">下一页➡️</a></p>
</div>

View File

@ -120,6 +120,6 @@ func threeSum1(nums []int) [][]int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0013.Roman-to-Integer/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0016.3Sum-Closest/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0013.Roman-to-Integer/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0016.3Sum-Closest/">下一页➡️</a></p>
</div>

View File

@ -91,6 +91,6 @@ func abs(a int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0015.3Sum/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0017.Letter-Combinations-of-a-Phone-Number/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0015.3Sum/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number/">下一页➡️</a></p>
</div>

View File

@ -146,6 +146,6 @@ func letterFunc(res string, digits string) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0016.3Sum-Closest/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0018.4Sum/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0016.3Sum-Closest/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0018.4Sum/">下一页➡️</a></p>
</div>

View File

@ -99,6 +99,6 @@ func fourSum(nums []int, target int) [][]int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0017.Letter-Combinations-of-a-Phone-Number/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0019.Remove-Nth-Node-From-End-of-List/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0017.Letter-Combinations-of-a-Phone-Number/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List/">下一页➡️</a></p>
</div>

View File

@ -102,6 +102,6 @@ func removeNthFromEnd1(head *ListNode, n int) *ListNode {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0018.4Sum/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0020.Valid-Parentheses/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0018.4Sum/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0020.Valid-Parentheses/">下一页➡️</a></p>
</div>

View File

@ -98,6 +98,6 @@ func isValid(s string) bool {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0019.Remove-Nth-Node-From-End-of-List/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0021.Merge-Two-Sorted-Lists/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0019.Remove-Nth-Node-From-End-of-List/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0021.Merge-Two-Sorted-Lists/">下一页➡️</a></p>
</div>

View File

@ -55,6 +55,6 @@ func mergeTwoLists(l1 *ListNode, l2 *ListNode) *ListNode {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0020.Valid-Parentheses/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0022.Generate-Parentheses/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0020.Valid-Parentheses/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0022.Generate-Parentheses/">下一页➡️</a></p>
</div>

View File

@ -62,6 +62,6 @@ func findGenerateParenthesis(lindex, rindex int, str string, res *[]string) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0021.Merge-Two-Sorted-Lists/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0023.Merge-k-Sorted-Lists/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0021.Merge-Two-Sorted-Lists/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0023.Merge-k-Sorted-Lists/">下一页➡️</a></p>
</div>

View File

@ -76,6 +76,6 @@ func mergeTwoLists1(l1 *ListNode, l2 *ListNode) *ListNode {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0022.Generate-Parentheses/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0024.Swap-Nodes-in-Pairs/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0022.Generate-Parentheses/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0024.Swap-Nodes-in-Pairs/">下一页➡️</a></p>
</div>

View File

@ -73,6 +73,6 @@ func swapPairs(head *ListNode) *ListNode {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0023.Merge-k-Sorted-Lists/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0025.Reverse-Nodes-in-k-Group/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0023.Merge-k-Sorted-Lists/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0025.Reverse-Nodes-in-k-Group/">下一页➡️</a></p>
</div>

View File

@ -76,6 +76,6 @@ func reverse(first *ListNode, last *ListNode) *ListNode {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0024.Swap-Nodes-in-Pairs/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0026.Remove-Duplicates-from-Sorted-Array/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0024.Swap-Nodes-in-Pairs/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0026.Remove-Duplicates-from-Sorted-Array/">下一页➡️</a></p>
</div>

View File

@ -130,6 +130,6 @@ func removeElement1(nums []int, start, val int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0025.Reverse-Nodes-in-k-Group/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0027.Remove-Element/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0025.Reverse-Nodes-in-k-Group/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0027.Remove-Element/">下一页➡️</a></p>
</div>

View File

@ -93,6 +93,6 @@ func removeElement(nums []int, val int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0026.Remove-Duplicates-from-Sorted-Array/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0028.Implement-strStr/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0026.Remove-Duplicates-from-Sorted-Array/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0028.Implement-strStr/">下一页➡️</a></p>
</div>

View File

@ -88,6 +88,6 @@ func strStr1(haystack string, needle string) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0027.Remove-Element/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0029.Divide-Two-Integers/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0027.Remove-Element/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0029.Divide-Two-Integers/">下一页➡️</a></p>
</div>

View File

@ -150,6 +150,6 @@ func divide1(divided int, divisor int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0028.Implement-strStr/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0030.Substring-with-Concatenation-of-All-Words/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0028.Implement-strStr/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0030.Substring-with-Concatenation-of-All-Words/">下一页➡️</a></p>
</div>

View File

@ -100,6 +100,6 @@ func copyMap(s map[string]int) map[string]int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0029.Divide-Two-Integers/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0033.Search-in-Rotated-Sorted-Array/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0029.Divide-Two-Integers/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0033.Search-in-Rotated-Sorted-Array/">下一页➡️</a></p>
</div>

View File

@ -80,6 +80,6 @@ func search33(nums []int, target int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0030.Substring-with-Concatenation-of-All-Words/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0030.Substring-with-Concatenation-of-All-Words/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array/">下一页➡️</a></p>
</div>

View File

@ -123,6 +123,6 @@ func searchLastLessElement(nums []int, target int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0033.Search-in-Rotated-Sorted-Array/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0035.Search-Insert-Position/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0033.Search-in-Rotated-Sorted-Array/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0035.Search-Insert-Position/">下一页➡️</a></p>
</div>

View File

@ -67,6 +67,6 @@ func searchInsert(nums []int, target int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0036.Valid-Sudoku/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0034.Find-First-and-Last-Position-of-Element-in-Sorted-Array/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0036.Valid-Sudoku/">下一页➡️</a></p>
</div>

View File

@ -170,6 +170,6 @@ func isValidSudoku1(board [][]byte) bool {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0035.Search-Insert-Position/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0037.Sudoku-Solver/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0035.Search-Insert-Position/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0037.Sudoku-Solver/">下一页➡️</a></p>
</div>

View File

@ -120,6 +120,6 @@ func checkSudoku(board *[][]byte, pos position, val int) bool {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0036.Valid-Sudoku/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0039.Combination-Sum/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0036.Valid-Sudoku/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0039.Combination-Sum/">下一页➡️</a></p>
</div>

View File

@ -89,6 +89,6 @@ func findcombinationSum(nums []int, target, index int, c []int, res *[][]int) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0037.Sudoku-Solver/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0040.Combination-Sum-II/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0037.Sudoku-Solver/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0040.Combination-Sum-II/">下一页➡️</a></p>
</div>

View File

@ -91,6 +91,6 @@ func findcombinationSum2(nums []int, target, index int, c []int, res *[][]int) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0039.Combination-Sum/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0041.First-Missing-Positive/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0039.Combination-Sum/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0041.First-Missing-Positive/">下一页➡️</a></p>
</div>

View File

@ -68,6 +68,6 @@ func firstMissingPositive(nums []int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0040.Combination-Sum-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0042.Trapping-Rain-Water/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0040.Combination-Sum-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0042.Trapping-Rain-Water/">下一页➡️</a></p>
</div>

View File

@ -63,6 +63,6 @@ func trap(height []int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0041.First-Missing-Positive/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0046.Permutations/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0041.First-Missing-Positive/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0046.Permutations/">下一页➡️</a></p>
</div>

View File

@ -68,6 +68,6 @@ func generatePermutation(nums []int, index int, p []int, res *[][]int, used *[]b
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0042.Trapping-Rain-Water/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0047.Permutations-II/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0042.Trapping-Rain-Water/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0047.Permutations-II/">下一页➡️</a></p>
</div>

View File

@ -72,6 +72,6 @@ func generatePermutation47(nums []int, index int, p []int, res *[][]int, used *[
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0046.Permutations/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0048.Rotate-Image/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0046.Permutations/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0048.Rotate-Image/">下一页➡️</a></p>
</div>

View File

@ -129,6 +129,6 @@ func rotate(matrix [][]int) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0047.Permutations-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0049.Group-Anagrams/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0047.Permutations-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0049.Group-Anagrams/">下一页➡️</a></p>
</div>

View File

@ -74,6 +74,6 @@ func groupAnagrams(strs []string) [][]string {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0048.Rotate-Image/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0050.Powx-n/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0048.Rotate-Image/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0050.Powx-n/">下一页➡️</a></p>
</div>

View File

@ -71,6 +71,6 @@ func myPow(x float64, n int) float64 {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0049.Group-Anagrams/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0051.N-Queens/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0049.Group-Anagrams/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0051.N-Queens/">下一页➡️</a></p>
</div>

View File

@ -136,6 +136,6 @@ func generateBoard(n int, row *[]int) []string {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0050.Powx-n/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0052.N-Queens-II/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0050.Powx-n/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0052.N-Queens-II/">下一页➡️</a></p>
</div>

View File

@ -109,6 +109,6 @@ func putQueen52(n, index int, col, dia1, dia2 *[]bool, row *[]int, res *int) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0051.N-Queens/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0053.Maximum-Subarray/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0051.N-Queens/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0053.Maximum-Subarray/">下一页➡️</a></p>
</div>

View File

@ -77,6 +77,6 @@ func maxSubArray1(nums []int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0052.N-Queens-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0054.Spiral-Matrix/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0052.N-Queens-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0054.Spiral-Matrix/">下一页➡️</a></p>
</div>

View File

@ -167,6 +167,6 @@ func spiralOrder2(matrix [][]int) []int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0053.Maximum-Subarray/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0055.Jump-Game/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0053.Maximum-Subarray/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0055.Jump-Game/">下一页➡️</a></p>
</div>

View File

@ -60,6 +60,6 @@ func canJump(nums []int) bool {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0054.Spiral-Matrix/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0056.Merge-Intervals/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0054.Spiral-Matrix/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0056.Merge-Intervals/">下一页➡️</a></p>
</div>

View File

@ -111,6 +111,6 @@ func quickSort(a []Interval, lo, hi int) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0055.Jump-Game/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0057.Insert-Interval/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0055.Jump-Game/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0057.Insert-Interval/">下一页➡️</a></p>
</div>

View File

@ -77,6 +77,6 @@ func insert(intervals []Interval, newInterval Interval) []Interval {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0056.Merge-Intervals/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0059.Spiral-Matrix-II/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0056.Merge-Intervals/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0059.Spiral-Matrix-II/">下一页➡️</a></p>
</div>

View File

@ -96,6 +96,6 @@ func generateMatrix(n int) [][]int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0057.Insert-Interval/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0060.Permutation-Sequence/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0057.Insert-Interval/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0060.Permutation-Sequence/">下一页➡️</a></p>
</div>

View File

@ -98,6 +98,6 @@ func findPermutation(n, index int, k *int, p []int, res *string, used *[]bool) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0059.Spiral-Matrix-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0061.Rotate-List/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0059.Spiral-Matrix-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0061.Rotate-List/">下一页➡️</a></p>
</div>

View File

@ -83,6 +83,6 @@ func rotateRight(head *ListNode, k int) *ListNode {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0060.Permutation-Sequence/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0062.Unique-Paths/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0060.Permutation-Sequence/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0062.Unique-Paths/">下一页➡️</a></p>
</div>

View File

@ -71,6 +71,6 @@ func uniquePaths(m int, n int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0061.Rotate-List/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0063.Unique-Paths-II/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0061.Rotate-List/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0063.Unique-Paths-II/">下一页➡️</a></p>
</div>

View File

@ -82,6 +82,6 @@ func uniquePathsWithObstacles(obstacleGrid [][]int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0062.Unique-Paths/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0064.Minimum-Path-Sum/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0062.Unique-Paths/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0064.Minimum-Path-Sum/">下一页➡️</a></p>
</div>

View File

@ -95,6 +95,6 @@ func minPathSum1(grid [][]int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0063.Unique-Paths-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0066.Plus-One/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0063.Unique-Paths-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0066.Plus-One/">下一页➡️</a></p>
</div>

View File

@ -65,6 +65,6 @@ func plusOne(digits []int) []int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0064.Minimum-Path-Sum/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0067.Add-Binary/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0064.Minimum-Path-Sum/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0067.Add-Binary/">下一页➡️</a></p>
</div>

View File

@ -78,6 +78,6 @@ func addBinary(a string, b string) string {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0066.Plus-One/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0069.Sqrtx/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0066.Plus-One/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0069.Sqrtx/">下一页➡️</a></p>
</div>

View File

@ -93,6 +93,6 @@ func mySqrt1(x int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0067.Add-Binary/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0070.Climbing-Stairs/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0067.Add-Binary/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0070.Climbing-Stairs/">下一页➡️</a></p>
</div>

View File

@ -57,6 +57,6 @@ func climbStairs(n int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0069.Sqrtx/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0071.Simplify-Path/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0069.Sqrtx/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0071.Simplify-Path/">下一页➡️</a></p>
</div>

View File

@ -119,6 +119,6 @@ func simplifyPath1(path string) string {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0070.Climbing-Stairs/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0074.Search-a-2D-Matrix/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0070.Climbing-Stairs/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0074.Search-a-2D-Matrix/">下一页➡️</a></p>
</div>

View File

@ -74,6 +74,6 @@ func searchMatrix(matrix [][]int, target int) bool {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0071.Simplify-Path/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0075.Sort-Colors/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0071.Simplify-Path/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0075.Sort-Colors/">下一页➡️</a></p>
</div>

View File

@ -74,6 +74,6 @@ func sortColors(nums []int) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0074.Search-a-2D-Matrix/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0076.Minimum-Window-Substring/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0074.Search-a-2D-Matrix/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0076.Minimum-Window-Substring/">下一页➡️</a></p>
</div>

View File

@ -78,6 +78,6 @@ func minWindow(s string, t string) string {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0075.Sort-Colors/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0077.Combinations/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0075.Sort-Colors/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0077.Combinations/">下一页➡️</a></p>
</div>

View File

@ -62,6 +62,6 @@ func generateCombinations(n, k, start int, c []int, res *[][]int) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0076.Minimum-Window-Substring/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0078.Subsets/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0076.Minimum-Window-Substring/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0078.Subsets/">下一页➡️</a></p>
</div>

View File

@ -107,6 +107,6 @@ func subsets2(nums []int) [][]int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0077.Combinations/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0079.Word-Search/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0077.Combinations/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0079.Word-Search/">下一页➡️</a></p>
</div>

View File

@ -85,6 +85,6 @@ func searchWord(board [][]byte, visited [][]bool, word string, index, x, y int)
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0078.Subsets/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0080.Remove-Duplicates-from-Sorted-Array-II/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0078.Subsets/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0080.Remove-Duplicates-from-Sorted-Array-II/">下一页➡️</a></p>
</div>

View File

@ -107,6 +107,6 @@ func removeDuplicates80(nums []int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0079.Word-Search/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0081.Search-in-Rotated-Sorted-Array-II/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0079.Word-Search/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0081.Search-in-Rotated-Sorted-Array-II/">下一页➡️</a></p>
</div>

View File

@ -87,6 +87,6 @@ func search(nums []int, target int) bool {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0080.Remove-Duplicates-from-Sorted-Array-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0082.Remove-Duplicates-from-Sorted-List-II/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0080.Remove-Duplicates-from-Sorted-Array-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0082.Remove-Duplicates-from-Sorted-List-II/">下一页➡️</a></p>
</div>

View File

@ -193,6 +193,6 @@ func deleteDuplicates4(head *ListNode) *ListNode {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0081.Search-in-Rotated-Sorted-Array-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0083.Remove-Duplicates-from-Sorted-List/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0081.Search-in-Rotated-Sorted-Array-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0083.Remove-Duplicates-from-Sorted-List/">下一页➡️</a></p>
</div>

View File

@ -68,6 +68,6 @@ func deleteDuplicates(head *ListNode) *ListNode {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0082.Remove-Duplicates-from-Sorted-List-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0084.Largest-Rectangle-in-Histogram/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0082.Remove-Duplicates-from-Sorted-List-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0084.Largest-Rectangle-in-Histogram/">下一页➡️</a></p>
</div>

View File

@ -77,6 +77,6 @@ func largestRectangleArea(heights []int) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0083.Remove-Duplicates-from-Sorted-List/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0086.Partition-List/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0083.Remove-Duplicates-from-Sorted-List/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0086.Partition-List/">下一页➡️</a></p>
</div>

View File

@ -150,6 +150,6 @@ func genListNode(head *DoublyListNode) *ListNode {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0084.Largest-Rectangle-in-Histogram/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0088.Merge-Sorted-Array/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0084.Largest-Rectangle-in-Histogram/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0088.Merge-Sorted-Array/">下一页➡️</a></p>
</div>

View File

@ -71,6 +71,6 @@ func merge(nums1 []int, m int, nums2 []int, n int) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0086.Partition-List/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0089.Gray-Code/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0086.Partition-List/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0089.Gray-Code/">下一页➡️</a></p>
</div>

View File

@ -119,6 +119,6 @@ func grayCode1(n int) []int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0088.Merge-Sorted-Array/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0090.Subsets-II/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0088.Merge-Sorted-Array/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0090.Subsets-II/">下一页➡️</a></p>
</div>

View File

@ -78,6 +78,6 @@ func generateSubsetsWithDup(nums []int, k, start int, c []int, res *[][]int) {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0089.Gray-Code/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0091.Decode-Ways/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0089.Gray-Code/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0091.Decode-Ways/">下一页➡️</a></p>
</div>

View File

@ -84,6 +84,6 @@ func numDecodings(s string) int {
----------------------------------------------
<div style="display: flex;justify-content: space-between;align-items: center;">
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0090.Subsets-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0092.Reverse-Linked-List-II/">下一页➡️</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0090.Subsets-II/">⬅️上一页</a></p>
<p><a href="https://books.halfrost.com/leetcode/ChapterFour/0001~0099/0092.Reverse-Linked-List-II/">下一页➡️</a></p>
</div>

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