Documentation
¶
Index ¶
- Constants
- func DuplicateZeros(arr []int)
- func FindAndReplacePattern(words []string, pattern string) []string
- func FindFrequentTreeSum(root *binaryTree.Node) []int
- func FindPairs(nums []int, k int) int
- func FindSubstring(s string, words []string) []int
- func Insert(aNode *linkedList.ListNode, x int) *linkedList.ListNode
- func MinFlipsMonoIncr(s string) int
- func MinFlipsMonoIncr2(s string) int
- func MinFlipsMonoIncr3(s string) int
- func NumPrimeArrangements(n int) int
- func SmallestDistancePair(nums []int, k int) int
- func SmallestDistancePair2(nums []int, k int) int
- func WiggleSort(nums []int)
- type Codec
- type RangeModule
- type SegmentNode
- type Solution
Constants ¶
View Source
const N = 1000000007
View Source
const (
N1 = 1000000010
)
Variables ¶
This section is empty.
Functions ¶
func FindAndReplacePattern ¶
func FindFrequentTreeSum ¶
func FindFrequentTreeSum(root *binaryTree.Node) []int
func FindSubstring ¶
FindSubstring https://leetcode.cn/problems/substring-with-concatenation-of-all-words/
给定一个字符串s和一些长度相同的单词words 。找出 s 中恰好可以由words 中所有单词串联形成的子串的起始位置。
注意子串要与words中的单词完全匹配,中间不能有其他字符 ,但不需要考虑words中单词串联的顺序。
func Insert ¶
func Insert(aNode *linkedList.ListNode, x int) *linkedList.ListNode
给定循环单调非递减列表中的一个点,写一个函数向这个列表中插入一个新元素 insertVal ,使这个列表仍然是循环升序的。
给定的可以是这个列表中任意一个顶点的指针,并不一定是这个列表中最小元素的指针。
如果有多个满足条件的插入位置,可以选择任意一个位置插入新的值,插入后整个列表仍然保持有序。
如果列表为空(给定的节点是 null),需要创建一个循环有序列表并返回这个节点。否则。请返回原先给定的节点。
func MinFlipsMonoIncr ¶
func NumPrimeArrangements ¶
func SmallestDistancePair2 ¶
func WiggleSort ¶
func WiggleSort(nums []int)
Types ¶
type Codec ¶
type Codec struct {
// contains filtered or unexported fields
}
func Constructor ¶
func Constructor() Codec
type RangeModule ¶
type RangeModule struct {
Root *SegmentNode
}
func Constructor1 ¶
func Constructor1() RangeModule
func (*RangeModule) AddRange ¶
func (node *RangeModule) AddRange(left int, right int)
func (*RangeModule) QueryRange ¶
func (node *RangeModule) QueryRange(left int, right int) bool
func (*RangeModule) RemoveRange ¶
func (node *RangeModule) RemoveRange(left int, right int)
type SegmentNode ¶
type SegmentNode struct {
Ls, Rs *SegmentNode
// add 代表懒标记
Add int
// 代表要统计的值
Val int
}
Source Files
¶
- 6-11-minFlipsMonoIncr.go
- 6-12-findAndReplacePattern.go
- 6-13-heightChecker.go
- 6-14-findDiagonalOrder.go
- 6-15-smallestDistancePair.go
- 6-16-findPairs.go
- 6-17-duplicateZeros.go
- 6-18-insert.go
- 6-19-findFrequentTreeSum.go
- 6-20-RangeModule.go
- 6-21-defangIPaddr.go
- 6-22-findBottomLeftValue.go
- 6-23-findSubstring.go
- 6-24-largestValues.go
- 6-26-Pick.go
- 6-27-findLUSlength.go
- 6-28-wiggleSort.go
- 6-29-encodedecode.go
- 6-30-numPrimeArrangements.go
Click to show internal directories.
Click to hide internal directories.