_021_05

package
v0.0.0-...-982d520 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2024 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AllPathFromSourceToTarget

func AllPathFromSourceToTarget(graph [][]int) [][]int

func BrickWall

func BrickWall(wall [][]int) int

func BuildAnArrayOfProduct

func BuildAnArrayOfProduct(a []int) []int

func BulbSwitcherIV

func BulbSwitcherIV(target string) int

func CircusTowerLCCI

func CircusTowerLCCI(height []int, weight []int) int

TODO: 我是笨比

func CountTripletsThatCanFormTwoArraysOfEqualXOR

func CountTripletsThatCanFormTwoArraysOfEqualXOR(arr []int) int

func CourseSchedule

func CourseSchedule(numCourses int, prerequisites [][]int) bool

拓扑排列 DFS

func CourseSchedule2

func CourseSchedule2(numCourses int, prerequisites [][]int) bool

拓扑排列 BFS

func CousinsInBinaryTree

func CousinsInBinaryTree(root *TreeNode, x, y int) bool

func DecodeXORedArray

func DecodeXORedArray(encoded []int, first int) []int

func DecodeXORedPermutation

func DecodeXORedPermutation(encoded []int) []int

func DeleteAndEarn

func DeleteAndEarn(nums []int) int

dp:数组

func EmployeeImportance2

func EmployeeImportance2(employees []*Employee, id int) int

func FindKthLargestXORCoordinateValue

func FindKthLargestXORCoordinateValue(matrix [][]int, k int) int

func FindLargestValueInEachTreeRow

func FindLargestValueInEachTreeRow(root *TreeNode) []int

func FindPeakElement

func FindPeakElement(nums []int) int

func FindPeakElement2

func FindPeakElement2(nums []int) int

笨比解法

func FindPeakElement3

func FindPeakElement3(nums []int) int

递归二分

func HammingDistance

func HammingDistance(x, y int) int

func IncreasingTripletSubsequence

func IncreasingTripletSubsequence(nums []int) bool

func IntegerReplacement2

func IntegerReplacement2(n int) int

dp:超时

func IntegerReplacement3

func IntegerReplacement3(n int) int

位运算

func IntegerToRoman

func IntegerToRoman(num int) string

func KeysAndRooms

func KeysAndRooms(rooms [][]int) bool

func LeafSimilarTrees

func LeafSimilarTrees(root1, root2 *TreeNode) bool

func LinkedListComponents

func LinkedListComponents(head *ListNode, nums []int) int

func LongestConsecutiveSequence

func LongestConsecutiveSequence(nums []int) int

func LongestConsecutiveSequence2

func LongestConsecutiveSequence2(nums []int) int

TODO: dp 有问题

func LongestSubstringWithoutRepeatingCharacters

func LongestSubstringWithoutRepeatingCharacters(s string) int

func LongestZigzagPathInABinaryTree

func LongestZigzagPathInABinaryTree(root *TreeNode) int

func MaxNumberOfKSumPairs

func MaxNumberOfKSumPairs(nums []int, k int) int

func MaxNumberOfKSumPairs2

func MaxNumberOfKSumPairs2(nums []int, k int) int

hash

func MaxSumOfRectangleNoLargerThanK

func MaxSumOfRectangleNoLargerThanK(matrix [][]int, k int) int

func MaximumLevelSumOfABinaryTree

func MaximumLevelSumOfABinaryTree(root *TreeNode) int

func MaximumProfitOfTheStock

func MaximumProfitOfTheStock(prices []int) int

func MinimumElementsToAddToFormAGivenSum

func MinimumElementsToAddToFormAGivenSum(nums []int, limit, goal int) int

func MinimumNumberOfDaysToMakeMBouquets

func MinimumNumberOfDaysToMakeMBouquets(bloomDay []int, m, k int) int

func MostProfitAssigningWork

func MostProfitAssigningWork(difficulty, profit, worker []int) int

func NumberOfDiceRollsWithTargetSum

func NumberOfDiceRollsWithTargetSum(d, f, target int) int

func NumberOfSubmatricesThatSumToTarget

func NumberOfSubmatricesThatSumToTarget(matrix [][]int, target int) int

func NumberOfWaysToStayInTheSamePlaceAfterSomeSteps

func NumberOfWaysToStayInTheSamePlaceAfterSomeSteps(steps, arrLen int) int

func OnesAndZeros

func OnesAndZeros(strs []string, m, n int) int

func PerfectSquares

func PerfectSquares(n int) int

func PowerOfFour

func PowerOfFour(n int) bool

func PowerOfTwo

func PowerOfTwo(n int) bool

func PowerOfTwo2

func PowerOfTwo2(n int) bool

func PredictTheWinner

func PredictTheWinner(nums []int) bool

func PrintBinaryTreeFromTopToBottom

func PrintBinaryTreeFromTopToBottom(root *TreeNode) []int

func QueensThatCanAttackKing

func QueensThatCanAttackKing(queens [][]int, king []int) [][]int

func ReverseInteger

func ReverseInteger(x int) int

func ReverseSubstringsBetweenEachPairOfParentheses

func ReverseSubstringsBetweenEachPairOfParentheses(s string) string

func RomanToInteger

func RomanToInteger(s string) int

func SatisfiabilityOfEqualityEquations

func SatisfiabilityOfEqualityEquations(equations []string) bool

func SingleElementInASortedArray

func SingleElementInASortedArray(nums []int) int

func SingleElementInASortedArray2

func SingleElementInASortedArray2(nums []int) int

func SingleElementInASortedArray3

func SingleElementInASortedArray3(nums []int) int

func SmallestDifference

func SmallestDifference(a, b []int) int

func StrangePrinter

func StrangePrinter(s string) int

func SubarraySumEqualsK

func SubarraySumEqualsK(nums []int, k int) int

func SubarraySumEqualsK2

func SubarraySumEqualsK2(nums []int, k int) int

func TeemoAttacking

func TeemoAttacking(timeSeries []int, duration int) int

func ThreeSum

func ThreeSum(nums []int) [][]int

func ThreeSumClosest

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

func TopKFrequent

func TopKFrequent(words []string, k int) []string

func TotalHammingDistance

func TotalHammingDistance(nums []int) int

func TwoSum

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

func TwoSum2

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

func UncrossedLines

func UncrossedLines(nums1 []int, nums2 []int) int

func UniqueBinarySearchTrees

func UniqueBinarySearchTrees(n int) int

func XOROperationInAnArray

func XOROperationInAnArray(n, start int) int

func XORQueriesOfASubarray

func XORQueriesOfASubarray(arr []int, queries [][]int) []int

Types

type Employee

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

type ListNode

type ListNode struct {
	Val  int
	Next *ListNode
}

func LinkedListCycleII

func LinkedListCycleII(head *ListNode) *ListNode

func LinkedListCycleII2

func LinkedListCycleII2(head *ListNode) *ListNode

hash

type TreeNode

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

func AddOneRowToTree

func AddOneRowToTree(root *TreeNode, val, depth int) *TreeNode

func DeleteNodesAndReturnForest

func DeleteNodesAndReturnForest(root *TreeNode, to_delete []int) []*TreeNode

func Successor

func Successor(root, p *TreeNode) *TreeNode

func Successor2

func Successor2(root, p *TreeNode) *TreeNode

func Successor3

func Successor3(root, p *TreeNode) *TreeNode

Source Files

Jump to

Keyboard shortcuts

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