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

This section is empty.

Types

type NumArray

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

https://leetcode.com/problems/range-sum-query-immutable/

func Constructor

func Constructor(nums []int) NumArray

calculate prefix sum.

func (*NumArray) SumRange

func (t *NumArray) SumRange(left int, right int) int

return the sum of the elements of nums between indices left and right inclusive.

Jump to

Keyboard shortcuts

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