leetcode

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: 0BSD Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CarPooling

func CarPooling(trips [][]int, capacity int) bool

resolve by embed. Input: trips = [[2,1,5],[3,3,7]], capacity = 4. Output: false. 0 <= fromi < toi <= 1000.

func CarPoolingByClass

func CarPoolingByClass(trips [][]int, capacity int) bool

CarPoolingByClass resolve by pre-define class.

Types

type Difference

type Difference struct {
	// contains filtered or unexported fields
}

diff array algorithm, detail: https://labuladong.gitee.io/algo/2/20/25/

func Constructor

func Constructor(array []int) Difference

Constructor a new Difference Object.

func (*Difference) Increment

func (d *Difference) Increment(i, j, val int)

Increment diff array add certainly value 'val' from indices i to j.

func (*Difference) Result

func (d *Difference) Result() []int

Result return the result array after a series of operations.

Jump to

Keyboard shortcuts

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