leetcode

package
v0.0.0-...-0158116 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

1 <= s.length <= 500
s 只包含小写英文字母。

输入: -1->5->3->4->0 输出: -1->0->3->4->5

输出: 6

进阶: 如果输入字符串包含 unicode 字符怎么办?你能否调整你的解法来应对这种情况?

必须在原数组上操作,不能拷贝额外的数组。 尽量减少操作次数。

来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/longest-substring-without-repeating-characters 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。

nums1.length == m
nums2.length == n
0 <= m <= 1000
0 <= n <= 1000
1 <= m + n <= 2000
-106 <= nums1[i], nums2[i] <= 106

0 <= points.length <= 104
points[i].length == 2
-231 <= xstart < xend <= 231 - 1

解释: 两个元组如下: 1. (0, 0, 0, 1) -> A[0] + B[0] + C[0] + D[1] = 1 + (-2) + (-1) + 2 = 0 2. (1, 1, 0, 0) -> A[1] + B[1] + C[0] + D[0] = 2 + (-1) + (-1) + 0 = 0

给定数组的长度不会超过50000。 输入数组中的所有数字都在32位整数的表示范围内

来源:力扣(LeetCode) 链接:https://leetcode-cn.com/problems/zigzag-conversion 著作权归领扣网络所有。商业转载请联系官方授权,非商业转载请注明出处。

假设我们的环境只能存储得下 32 位的有符号整数,则其数值范围为 [−231, 231 − 1]。请根据这个假设,如果反转后整数溢出那么就返回 0。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewCommand

func NewCommand() *cobra.Command

func T1_TwoSum

func T1_TwoSum(nums []int, target int) []int

Types

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

ListNode 节点

type SI

type SI struct {
	D float64
	X int
	Y int
}

SI SI

type SII

type SII []SI

SII SII

func (SII) Len

func (sii SII) Len() int

func (SII) Less

func (sii SII) Less(i, j int) bool

func (SII) Swap

func (sii SII) Swap(i, j int)

type TreeNode

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

TreeNode TreeNode

func NewTree

func NewTree(valSlice []int) *TreeNode

Directories

Path Synopsis
dynamic_programming

Jump to

Keyboard shortcuts

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