leetcode

package
v0.0.0-...-f59f4bf Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsPowerOf2

func IsPowerOf2(n int) bool

func MaxLen

func MaxLen(s []string) int

func MaxProduct

func MaxProduct(s []string) int

func Solution

func Solution(n int) []int

func Solution2

func Solution2(n int) []int

func Solution3

func Solution3(n int) []int

func Solution4

func Solution4(n int) []int

func Solution5

func Solution5(n int) []int

leetcode 338 原题,动态规划的转移方程:bits[i] = bits[i >> 1] + (i & 1)。 它的题解需要用n+1个元素的数组,我这里为了跟上面保持一致,就用n了

func Solution6

func Solution6(n int) []int

Types

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

Definition for singly-linked list.

func (*ListNode) ToSlice

func (l *ListNode) ToSlice() []int

Jump to

Keyboard shortcuts

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