Documentation
¶
Index ¶
- Constants
- func BTLCS(r *bstNode) uint
- func BTVertOrder(r *bstNode) [][]uint16
- func CWMoreWatter(ls []uint) uint
- func CombSum(n []uint, t uint) uint
- func CombinationSum(nums []int, s int) ([][]int, bool)
- func KClosest(e []int, t, k int) []int
- func KFreqWords(wds []string, k int) []string
- func MagicHash(key string, size int) int
- func MaxAvgSubarr(ns []int, l int) (int, int)
- func MaxI2(a, b int) int
- func MaxI3(a, b, c int) int
- func MergeTwo(arr1 []int, arr2 []int) []int
- func MinI3(a, b, c int) int
- func MinSubarrSum(nums []int, t int) (int, bool)
- func MissNumber(s []byte, r uint) (uint, uint, bool)
- func PartSubset(ns []uint) bool
- func ReverseWords(ws string) string
- func TopKFreWords(wds []string, k int) ([]string, error)
- type BinaryMatrix
- type Concordance
- type EDpoints
- type Employee
- type FirstUnique
- type Heap
- type HitCounter
- type IntHeap
- type Interval
- type Iterator
- type K9board
- type LRUCache
- type ListNode
- type Logger
- type MaxStack
- type MinStack
- type MyCalendar
- type Node
- type NumMatrix
- type PeekingIterator
- type PreNode
- type RDNode
- type RLEIterator
- type RandomizedSet
- type SCNode
- type SnapshotArray
- type Solution
- type SparseVector
- type TimeMap
- type TreeNode
- type WCHeap
- type Wdc
- type WordBreak
- type WordDictionary
Constants ¶
View Source
const ( SIGNROOM = 0x7fffffff SIGNGATE = 0 SIGNWALL = 0xffffffff )
View Source
const ( URL = "https://do.mcquay.us/ssh/short.txt" FAILUREKW = "Failed password" )
View Source
const EMPST = ""
Variables ¶
This section is empty.
Functions ¶
func BTVertOrder ¶
func BTVertOrder(r *bstNode) [][]uint16
func MissNumber ¶
Find the Missing Number, r < 30
func ReverseWords ¶
Types ¶
type Concordance ¶
type Concordance struct {
// contains filtered or unexported fields
}
type FirstUnique ¶
type FirstUnique struct {
// contains filtered or unexported fields
}
func FUConstructor ¶
func FUConstructor(nums []int) FirstUnique
func (*FirstUnique) Add ¶
func (fu *FirstUnique) Add(n int)
func (*FirstUnique) ShowFirstUnique ¶
func (fu *FirstUnique) ShowFirstUnique() int
type HitCounter ¶
type HitCounter struct {
// contains filtered or unexported fields
}
func (*HitCounter) GetHits ¶
func (hc *HitCounter) GetHits(ts int) int
- Return the number of hits in the past 5 minutes. @param timestamp - The current timestamp (in seconds granularity).
func (*HitCounter) Hit ¶
func (hc *HitCounter) Hit(ts int)
- Record a hit. @param timestamp - The current timestamp (in seconds granularity).
type LRUCache ¶
type LRUCache struct { Cap int Head *dLinkedNode Tail *dLinkedNode // contains filtered or unexported fields }
LRU Cache
type ListNode ¶
*
- Definition for singly-linked list.
- type ListNode struct {
- Val int
- Next *ListNode
- }
type MyCalendar ¶
type MyCalendar struct {
// contains filtered or unexported fields
}
func MyCalendarConstructor ¶
func MyCalendarConstructor() MyCalendar
func (*MyCalendar) Book ¶
func (c *MyCalendar) Book(s, e int) bool
type NumMatrix ¶
type NumMatrix struct {
// contains filtered or unexported fields
}
func NumMatrixConstructor ¶
type PeekingIterator ¶
type PeekingIterator struct {
// contains filtered or unexported fields
}
func PeekingIteratorConstructor ¶
func PeekingIteratorConstructor(iter *Iterator) *PeekingIterator
type RLEIterator ¶
type RLEIterator struct {
// contains filtered or unexported fields
}
func RLEConstructor ¶
func RLEConstructor(A []int) RLEIterator
func (*RLEIterator) Next ¶
func (it *RLEIterator) Next(n int) int
type RandomizedSet ¶
type RandomizedSet struct {
// contains filtered or unexported fields
}
func (*RandomizedSet) GetRandom ¶
func (rs *RandomizedSet) GetRandom() int
* Get a random element from the set.
func (*RandomizedSet) Insert ¶
func (rs *RandomizedSet) Insert(val int) bool
* Inserts a value to the set. Returns true if the set did not already contain the specified element.
func (*RandomizedSet) Remove ¶
func (rs *RandomizedSet) Remove(val int) bool
* Removes a value from the set. Returns true if the set contained the specified element.
type SnapshotArray ¶
type SnapshotArray struct {
// contains filtered or unexported fields
}
func SAConstructor ¶
func SAConstructor(l int) SnapshotArray
func (*SnapshotArray) Set ¶
func (sa *SnapshotArray) Set(index int, val int)
func (*SnapshotArray) Snap ¶
func (sa *SnapshotArray) Snap() int
type Solution ¶
type Solution struct {
// contains filtered or unexported fields
}
func RPIConstructor ¶
type SparseVector ¶
type SparseVector struct {
// contains filtered or unexported fields
}
* 1570. Dot Product of Two Sparse Vectors
*
- Your SparseVector object will be instantiated and called as such:
- v1 := Constructor(nums1);
- v2 := Constructor(nums2);
- ans := v1.dotProduct(v2);
func SVConstructor ¶
func SVConstructor(nums []int) SparseVector
type WordBreak ¶
type WordBreak struct {
// contains filtered or unexported fields
}
func (*WordBreak) CanWordBreak ¶
type WordDictionary ¶
type WordDictionary struct {
// contains filtered or unexported fields
}
* Need a flag in the tree node of if the word ends here
func WDConstructor ¶
func WDConstructor() WordDictionary
func (*WordDictionary) AddWord ¶
func (t *WordDictionary) AddWord(word string)
func (*WordDictionary) Search ¶
func (t *WordDictionary) Search(word string) bool
Click to show internal directories.
Click to hide internal directories.