Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
Parse parses Leetcode's string representation of a data structure or primitive type. For simplicity, Parse panics instead of returning an error. For parsing complex types, consider using dedicated functions like ParseTreeNode, ParseIntMatrix, etc.
func ParseByteMatrix ¶
ParseByteMatrix is a shorthand for Parse[[][]byte](s).
func ParseIntMatrix ¶
ParseIntMatrix is a shorthand for Parse[[][]int](s).
func ParseStringMatrix ¶
ParseStringMatrix is a shorthand for Parse[[][]string](s).
Types ¶
type IntMaxHeap ¶
type IntMaxHeap []int
IntMaxHeap is a Max-Heap implementation for integers. It allows you to quickly test heap-based solutions. However, after testing you'll need to copy this code and include it in your submission.
func (IntMaxHeap) Len ¶
func (h IntMaxHeap) Len() int
func (*IntMaxHeap) Pop ¶
func (h *IntMaxHeap) Pop() any
func (*IntMaxHeap) Push ¶
func (h *IntMaxHeap) Push(x any)
func (IntMaxHeap) Swap ¶
func (h IntMaxHeap) Swap(i int, j int)
type IntMinHeap ¶
type IntMinHeap []int
IntMinHeap is a Min-Heap implementation for integers. It allows you to quickly test heap-based solutions. However, after testing, you'll need to copy this code and include it in your submission.
func (IntMinHeap) Len ¶
func (h IntMinHeap) Len() int
func (*IntMinHeap) Pop ¶
func (h *IntMinHeap) Pop() any
func (*IntMinHeap) Push ¶
func (h *IntMinHeap) Push(x any)
func (IntMinHeap) Swap ¶
func (h IntMinHeap) Swap(i int, j int)
type ListNode ¶
func ParseListNode ¶
ParseListNode is a shorthand for Parse[*ListNode](s).
type NaryTreeNode ¶
type NaryTreeNode struct { Val int Children []*NaryTreeNode }
func ParseNaryTreeNode ¶
func ParseNaryTreeNode(s string) *NaryTreeNode
ParseNaryTreeNode is a shorthand for Parse[*NaryTreeNode](s).
func (*NaryTreeNode) String ¶
func (t *NaryTreeNode) String() string