common

package
v0.0.0-...-a49be92 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 20, 2024 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FixBrackets

func FixBrackets(nums string) string

func StrToByteArray

func StrToByteArray(str string) []byte

func StrToByteArrayArray

func StrToByteArrayArray(str string) [][]byte

func StrToIntArrArray

func StrToIntArrArray(nums string) [][]int

func StrToIntArray

func StrToIntArray(nums string) []int

func StrToStringArray

func StrToStringArray(str string) []string

func StrToStringArrayArray

func StrToStringArrayArray(str string) [][]string

Types

type Employee

type Employee struct {
	Id           int
	Importance   int
	Subordinates []int
}

Employee Definition for Employee.

func StrToEmployees

func StrToEmployees(str string) []*Employee

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

ListNode Definition for singly-linked list.

func StrToListNode

func StrToListNode(nums string, pos int) *ListNode

type NestedInteger

type NestedInteger struct {
}

NestedInteger This is the interface that allows for creating nested lists. You should not implement it, or speculate about its implementation

func StrToNestedIntegerList

func StrToNestedIntegerList(str string) []*NestedInteger

func (*NestedInteger) Add

func (n *NestedInteger) Add(elem NestedInteger)

Add Set this NestedInteger to hold a nested list and adds a nested integer to it.

func (NestedInteger) GetInteger

func (n NestedInteger) GetInteger() int

GetInteger Return the single integer that this NestedInteger holds, if it holds a single integer The result is undefined if this NestedInteger holds a nested list So before calling this method, you should have a check

func (NestedInteger) GetList

func (n NestedInteger) GetList() []*NestedInteger

GetList Return the nested list that this NestedInteger holds, if it holds a nested list The list length is zero if this NestedInteger holds a single integer You can access NestedInteger's List element directly if you want to modify it

func (NestedInteger) IsInteger

func (n NestedInteger) IsInteger() bool

IsInteger Return true if this NestedInteger holds a single integer, rather than a nested list.

func (*NestedInteger) SetInteger

func (n *NestedInteger) SetInteger(value int)

SetInteger Set this NestedInteger to hold a single integer.

type Node

type Node struct {
	Val      int
	Left     *Node
	Right    *Node
	Next     *Node
	Random   *Node
	Prev     *Node
	Child    *Node
	Children []*Node
}

type TreeNode

type TreeNode struct {
	Val   int
	Left  *TreeNode
	Right *TreeNode
}

*

  • Definition for a binary tree node.
  • type TreeNode struct {
  • Val int
  • Left *TreeNode
  • Right *TreeNode
  • }

func StrToTreeNode

func StrToTreeNode(nums string) *TreeNode

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL