MCPcopy Create free account

hub / github.com/HuberTRoy/leetCode / functions

Functions332 in github.com/HuberTRoy/leetCode

MethodlargestNumber
:type nums: List[int] :rtype: str
Array/LargestNumber.py:50
Methodleft
(x, y)
Array/SpiralMatrixII.py:80
MethodlengthOfLIS
:type nums: List[int] :rtype: int
DP/longesSubsequence.py:36
MethodlengthOfLastWord
:type s: str :rtype: int
String/LengthOfLastWord.py:14
MethodlengthOfLongestSubstring
:type s: str :rtype: int
String/LongesSubstrings.py:28
MethodletterCombinations
:type digits: str :rtype: List[str]
String/LetterCombinationsOfAPhoneNumber.py:36
MethodlevelOrder
:type root: TreeNode :rtype: List[List[int]]
BFS/BinaryTreeLevelOrderTraversal.py:43
MethodlevelOrderBottom
:type root: TreeNode :rtype: List[List[int]]
BFS/BinaryTreeLevelOrderTraversalII.py:38
MethodlongestCommonPrefix
:type strs: List[str] :rtype: str
String/LongestCommonPrefix.py:34
MethodlongestConsecutive
:type nums: List[int] :rtype: int
Array/LongestConsecutiveSequence.py:105
MethodlowestCommonAncestor
:type root: TreeNode :type p: TreeNode :type q: TreeNode :rtype: TreeNode
Tree/LowestCommonAncestorOfABinarySearchTree.py:58
MethodlowestCommonAncestor
:type root: TreeNode :type p: TreeNode :type q: TreeNode :rtype: TreeNode
Tree/LowestCommonAncestorOfABinaryTree.py:66
Methodmake
(preorder, inorder)
Tree/ConstructBinaryTreeFromPreorderAndInorderTraversal.py:51
MethodmakeBSTByInorder
(size)
Tree/ConvertSortedListToBinarySearchTree.py:128
MethodmakeBinarySearchTree
(nums)
Tree/ConvertSortedArrayToBinarySearchTree.py:62
MethodmakeEqual
(s, length=max_nums)
Array/LargestNumber.py:69
MethodmakeSubsets
(index, current_subsets)
Backtracking/subsets.py:41
MethodmakeTree
(inorder, postorder)
Tree/ConstructBinaryTreeFromInorderAndPostorderTraversal.py:72
FunctionmakeValueInList
(value)
Sorted/sotred.py:95
MethodmakeXY
(x, y)
Array/SpiralMatrixII.py:36
MethodmaxArea
:type height: List[int] :rtype: int
Array/ContainerWithMostWater.py:141
MethodmaxAreaOfIsland
:type grid: List[List[str]] :rtype: int
Array/MaxAreaOfIsland.py:38
MethodmaxDepth
(self, root: TreeNode)
BFS/MaximumDepthOfBinaryTree.py:33
MethodmaxDistToClosest
:type seats: List[int] :rtype: int
Array/MaximizeDistanceToClosestPerson.py:45
MethodmaxIncreaseKeepingSkyline
:type grid: List[List[int]] :rtype: int
Array/max_increase_to_keep_city_skyline.py:33
MethodmaxPathSum
:type root: TreeNode :rtype: int
Tree/BinaryTreeMaximumPathSum.py:135
MethodmaxProduct
:type nums: List[int] :rtype: int
Array/MaximumProductSubarray.py:49
MethodmaxProfit
:type prices: List[int] :rtype: int
Array/BestTimeToBuyAndSellStockI_II.py:67
MethodmaxSlidingWindow
:type nums: List[int] :type k: int :rtype: List[int]
Array/SlidingWindowMaximum.py:62
MethodmaxSubArray
:type nums: List[int] :rtype: int
Array/MaximumSubarray.py:37
MethodmaxSubarraySumCircular
:type A: List[int] :rtype: int
Array/MaximumSumCircularSubarray.py:62
Methodmerge
:type intervals: List[Interval] :rtype: List[Interval]
Array/MergeArray.py:29
Methodmerge
:type nums1: List[int] :type m: int :type nums2: List[int] :type n: int :rtype: void Do not return anything,
Array/MergeSortedArray.py:122
FunctionmergeKLists
(lists)
Heap/MergeKSortedLists.js:14
MethodmergeKLists
:type lists: List[ListNode] :rtype: ListNode
Heap/MergeKSortedLists.py:34
FunctionmergeSort
(shuffledList)
Sorted/sotred.py:111
MethodmergeSort
归并排序的基本思路是分治,把一个大问题分解成小问题。逐个解决小问题。 以长度的一半为基准点,将一个大列表分为两个小列表,一直分一直分,然后合并。 所以排序分为两步: 第一步是分解,第二步是合并。
Array/KthLargestElementInAnArray.py:86
MethodmergeTwoLists
:type l1: ListNode :type l2: ListNode :rtype: ListNode
Array/MergerTwoSortedList.py:21
Methodmerge_sort
(l, r)
Sorted/SortList.py:131
MethodminAddToMakeValid
:type S: str :rtype: int
String/MinimumAddToMakeParenthesesValid.py:46
FunctionminCostClimbingStairs
(cost)
DP/MinCostClimbingStairs.js:33
MethodminFallingPathSum
:type A: List[List[int]] :rtype: int
Array/MinimumFallingPathSum.py:39
MethodminFlipsMonoIncr
:type S: str :rtype: int
DP/FlipStringToMonotoneIncreasing.py:47
MethodminPathSum
:type grid: List[List[int]] :rtype: int
Array/MinimumPathSum.py:45
MethodminWindow
:type s: str :type t: str :rtype: str
String/MinimumWindowSubstring.py:62
MethodminimumTotal
:type triangle: List[List[int]] :rtype: int
Array/Triangle.py:32
MethodmissingNumber
:type nums: List[int] :rtype: int
Array/MissingNumber.py:38
MethodmyAtoi
:type str: str :rtype: int
String/StringToInteger.py:68
MethodmySqrt
:type x: int :rtype: int
Number/Sqrt(x).py:29
Methodmycmp
(x, y)
Array/LargestNumber.py:62
Methodnext
:type n: int :rtype: int
Design/RLEIterator.py:62
MethodnumDecodings
:type s: str :rtype: int
DP/DecodeWays.py:55
MethodnumIslands
:type grid: List[List[str]] :rtype: int
Array/NumberOfIslands.py:39
MethodnumJewelsInStones
:type J: str :type S: str :rtype: int
String/JewelsAndStones.py:26
MethodnumSubarrayProductLessThanK
:type nums: List[int] :type k: int :rtype: int
DP/SubarrayProductLessThanK.py:27
MethodnumSubarraysWithSum
:type A: List[int] :type S: int :rtype: int
Array/BinarySubarraysWithSum.py:31
MethodnumUniqueEmails
:type emails: List[str] :rtype: int
String/UniqueEmailAddresses.py:41
MethododdEvenList
:type head: ListNode :rtype: ListNode
Array/OddEvenLinkedList.py:45
Methodpartition
:type head: ListNode :type x: int :rtype: ListNode
Array/PartitionList.py:26
MethodpartitionDisjoint
:type A: List[int] :rtype: int
Array/PartitionArrayIntoDisjointIntervals.py:59
MethodpathSum
:type root: TreeNode :type sum: int :rtype: List[List[int]]
Tree/PathSumII.py:38
Methodpeek
(self)
Stack/ImplementQueueUsingStack.py:60
MethodplusOne
:type digits: List[int] :rtype: List[int]
Array/PlusOne.py:29
Methodpop
(self)
Stack/GetMinStack.py:75
MethodprevPrint
(self)
Tree/BinarySearchTree.py:84
MethodproductExceptSelf
:type nums: List[int] :rtype: List[int]
Array/ProductOfArrayExceptSelf.py:44
Methodpush
(self, value)
Stack/GetMinStack.py:65
Methodput
:type key: int :type value: int :rtype: void
Design/LRUCache.py:92
Methodreduce_abc
(strs, currentStr="")
String/LetterCombinationsOfAPhoneNumber.py:54
MethodremoveDuplicates
:type nums: List[int] :rtype: int
Array/RemoveDuplicatesFromSortedArray.py:50
MethodremoveDuplicates
:type nums: List[int] :rtype: int
Array/RemoveDuplicatesFromSortedArrayII.py:46
MethodremoveElements
:type head: ListNode :type val: int :rtype: ListNode
Array/RemoveLinkedListElements.py:27
MethodremoveNthFromEnd
:type head: ListNode :type n: int :rtype: ListNode
Array/RemoveNthNodeFromEndOfList.py:64
MethodreplaceWords
:type dict: List[str] :type sentence: str :rtype: str
String/ReplaceWords.py:57
Methodreset
Resets the array to its original configuration and return it. :rtype: List[int]
Array/ShuffleAnArray.py:47
FunctionreverseKGroup
(head, k)
Array/ReverseNodesInk-Group.js:21
FunctionreverseList
(head)
Array/ReverseLinkedList.js:19
MethodreversePairs
:type nums: List[int] :rtype: int
DP/ReversePairs.py:44
MethodreverseString
:type s: str :rtype: str
String/ReverseString.py:28
Methodright
(x, y)
Array/SpiralMatrixII.py:46
MethodrightSideView
:type root: TreeNode :rtype: List[int]
Tree/BinaryTreeRightSideView.py:34
Methodrob
:type nums: List[int] :rtype: int
DP/HouseRobber.py:52
Methodrob
:type nums: List[int] :rtype: int
DP/HouseRobberII.py:45
MethodrotateRight
:type head: ListNode :type k: int :rtype: ListNode
Array/RotateList.py:51
Methodsearch
Returns if the word is in the trie. :type word: str :rtype: bool
Tree/Trie.py:65
Methodsearch
:type nums: List[int] :type target: int :rtype: int
Array/SearchInRotatedSortedArrayII.py:82
Methodsearch
:type nums: List[int] :type target: int :rtype: int
Array/SearchInRotatedSortedArray.py:94
MethodsearchMatrix
:type matrix: List[List[int]] :type target: int :rtype: bool
Array/Search2DMatrix.py:104
MethodsearchMatrix
(self, matrix, target)
Array/Search2DMatrixII.py:100
MethodsearchRange
:type nums: List[int] :type target: int :rtype: List[int]
Array/FindFirstAndLastPositionOfElementInSortedArray.py:113
FunctionselectionSort
(shuffledList)
Sorted/sotred.py:26
Methodserialize
Encodes a tree to a single string. :type root: TreeNode :rtype: str
Tree/SerializeAndDeserializeBinaryTree.py:131
MethodsetZeroes
:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.
Array/SetMatrixZeroes.py:69
MethodshiftingLetters
:type S: str :type shifts: List[int] :rtype: str
String/ShiftingLetters.py:43
Methodshuffle
Returns a random shuffling of the array. :rtype: List[int]
Array/ShuffleAnArray.py:54
MethodsimplifyPath
:type path: str :rtype: str
String/SimplifyPath.py:37
MethodsingleNumber
:type nums: List[int] :rtype: int
Array/SingleNumber.py:33
Methodsolve
:type board: List[List[str]] :rtype: void Do not return anything, modify board in-place instead.
Array/SurroundedRegions.py:68
MethodsortArrayByParity
:type A: List[int] :rtype: List[int]
Array/SortArrayByParity.py:31
MethodsortArrayByParityII
:type A: List[int] :rtype: List[int]
Array/SortArrayByParityII.py:27
← previousnext →201–300 of 332, ranked by callers