Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/RealHacker/leetcode-solutions
/ functions
Functions
604 in github.com/RealHacker/leetcode-solutions
⨍
Functions
604
◇
Types & classes
388
Method
productExceptSelf
(self, nums)
238_product_array/product_of_array_except_self.py:4
Method
push
(self, x)
225_impl_stack_using_queues/stack_using_queues.py:10
Method
push
:type x: int :rtype: nothing
225_impl_stack_using_queues/stack_using_queues_take2.py:9
Method
push
(self, x)
155_min_stack/min_stack.py:9
Method
push
(self, x)
232_make_queue_using_stacks/queue_using_stacks.py:9
Method
rangeBitwiseAnd
(self, m, n)
201_bitwise_and_of_number_range/bitwise_and_numbers.py:5
Method
read
:type buf: Destination buffer (List[str]) :type n: Maximum number of characters to read (int) :rtype: The number of character
157_read_n_chars/read_N_chars.py:7
Method
read
:type buf: Destination buffer (List[str]) :type n: Maximum number of characters to read (int) :rtype: The number of character
158_read_n_chars_ii/read_N_chars.py:9
Method
recoverTree
:type root: TreeNode :rtype: void Do not return anything, modify root in-place instead.
099_recover_binary_search_tree/recover_binary_search_tree.py:9
Method
removeDuplicateLetters
:type s: str :rtype: str
316_remove_duplicate_letters/remove_duplicate_letters.py:2
Method
removeDuplicateLetters
:type s: str :rtype: str
316_remove_duplicate_letters/remove_duplicate_letters_TLE.py:4
Method
removeDuplicates
(self, nums)
026_remove_duplicates_from_sorted_array/remove_duplicates_from_sorted_array.py:5
Method
removeDuplicates
:type nums: List[int] :rtype: int
080_reemove_duplicates_from_sorted_array_ii/remove_duplicates_from_sorted_array_2.py:2
Method
removeElement
:type nums: List[int] :type val: int :rtype: int
027_remove_element/remove_element.py:2
Method
removeElements
(self, head, val)
203_remove_linked_list_elements/remove_linked_list_elements.py:11
Method
removeNthFromEnd
:type head: ListNode :type n: int :rtype: ListNode
019_remove_nth_node_from_end/remove_nth_node.py:8
Method
reorderList
:type head: ListNode :rtype: void Do not return anything, modify head in-place instead.
143_reorder_list/reoder_list.py:2
Method
reverseBetween
:type head: ListNode :type m: int :type n: int :rtype: ListNode
092_reversed_linked_list_ii/reversed_linked_list.py:8
Method
reverseBits
(self, n)
190_reverse_bits/reverse_bits.py:4
Method
reverseKGroup
(self, head, k)
025_reverse_nodes_in_k_group/reverse_nodes_in_k_group.py:11
Method
reverseList
:type head: ListNode :rtype: ListNode
206_reverse_linked_list/reverse_linked_list.py:7
Method
reverseString
:type s: str :rtype: str
344_reverse_string/reverse.py:2
Method
reverseVowels
:type s: str :rtype: str
345_reverse_vowels/vowels.py:2
Method
reverseWords
:type s: a list of 1 length strings (List[str]) :rtype: nothing
186_reverse_words_in_a_string/reverse.py:2
Method
reverseWords
:type s: str :rtype: str
151_reverse_words_in_a_string/reverse_words_in_string.py:2
Method
rightSideView
(self, root)
199_binary_tree_right_view/binary_tree_rightside_view.py:11
Method
rob
(self, nums)
213_house_robber_ii/house_robber_ii.py:4
Method
rob
(self, nums)
198_house_robber/house_robber.py:4
Method
romanToInt
:type s: str :rtype: int
013_roman_to_integer/roman_to_integer.py:2
Method
rotate
(self, nums, k)
189_rotate_array/rotate_array.py:9
Method
rotate
(self, matrix)
048_rotate_image/rotate_image.py:7
Method
rotateRight
:type head: ListNode :type k: int :rtype: ListNode
061_rotate_list/rotate_list.py:2
Method
search
(self, nums, target)
081_search_in_rotated_sorted_array/search_in_rotated_sorted.py:2
Method
search
(self, word)
211_add_and_search_word/add_and_search_ds.py:23
Method
search
(self, word)
208_implement_trie/implement_trie_prefix_tree.py:26
Method
searchInsert
:type nums: List[int] :type target: int :rtype: int
035_search_insert_position/search_insert_position.py:2
Method
searchMatrix
(self, matrix, target)
074_search_2d_matrix/search_2d_matrix.py:6
Method
searchMatrix
(self, matrix, target)
240_search_2d_matrix/search_2d_matrix_ii.py:6
Method
searchMatrix
:type matrix: List[List[int]] :type target: int :rtype: bool
240_search_2d_matrix/search_2d_matrix_ii_take2.py:2
Method
searchRange
(self, nums, target)
034_search_for_a_range/search_for_range.py:6
Method
serialize
Encodes a tree to a single string. :type root: TreeNode :rtype: str
297_serialize_and_deserialize_binary_tree/serialize_and_desialize_binary_tree_MLE.py:10
Method
serialize
Encodes a tree to a single string. :type root: TreeNode :rtype: str
297_serialize_and_deserialize_binary_tree/serialize_and_desialize_binary_tree.py:10
Method
setZeroes
:type matrix: List[List[int]] :rtype: void Do not return anything, modify matrix in-place instead.
073_set_matrix_zeros/set_matrix_zeros.py:2
Method
shortest
Adds a word into the data structure. :type word1: str :type word2: str :rtype: int
244_shortest_word_distance_ii/shortest.py:14
Method
shortestDistance
:type grid: List[List[int]] :rtype: int
317_shortest_distance_from_all_buildings/shortest_distance.py:2
Method
shortestDistance
:type words: List[str] :type word1: str :type word2: str :rtype: int
243_shortest_word_distance/shortest.py:2
Method
shortestWordDistance
:type words: List[str] :type word1: str :type word2: str :rtype: int
245_shortest_word_distance_iii/shortest.py:2
Method
simplifyPath
:type path: str :rtype: str
071_simplify_path/simplify_path.py:2
Method
singleNumber
:type nums: List[int] :rtype: List[int]
260_single_number_iii/single_number_iii.py:2
Method
singleNumber
(self, nums)
137_single_number_ii/single_numbe_ii.py:4
Method
singleNumber
:type nums: List[int] :rtype: int
137_single_number_ii/single_number_ii.py:2
Method
singleNumber
:type nums: List[int] :rtype: int
136_single_number/single_number.py:2
Method
solve
(self, board)
130_surrounded_regions/surrounded_regions.py:4
Method
solve
(self, board)
130_surrounded_regions/surrounded_regions_TLE.py:4
Method
solveNQueens
:type n: int :rtype: List[List[str]]
051_n_queens/n_queens.py:2
Method
solveSudoku
:type board: List[List[str]] :rtype: void Do not return anything, modify board in-place instead.
037_sodoku_solver/sodoku_solver.py:2
Function
sortColors
(self, nums)
075_sort_colors/sort_colors_swap.py:1
Method
sortColors
(self, nums)
075_sort_colors/sort_colors.py:7
Method
sortedArrayToBST
:type nums: List[int] :rtype: TreeNode
108_sorted_array_to_bst/sorted_array_to_bst.py:9
Method
sortedListToBST
:type head: ListNode :rtype: TreeNode
109_convert_sorted_list_to_BST/convert_sorted_list_to_BST.py:2
Method
spiralOrder
:type matrix: List[List[int]] :rtype: List[int]
054_spiral_matrix/spiral_matrix.py:2
Method
startsWith
(self, prefix)
208_implement_trie/implement_trie_prefix_tree.py:38
Method
strStr
:type haystack: str :type needle: str :rtype: int
028_implement_strstr/strstr.py:2
Method
strobogrammaticInRange
:type low: str :type high: str :rtype: int
248_strobogrammatic_number_iii/strobo.py:2
Method
subsets
:type nums: List[int] :rtype: List[List[int]]
078_subsets/subsets.py:3
Method
subsetsWithDup
:type nums: List[int] :rtype: List[List[int]]
090_subsets_ii/subsets_ii.py:2
Method
sumNumbers
(self, root)
129_sum_root_to_leaf/sum_root_to_leaf.py:11
Method
sumRange
sum of elements nums[i..j], inclusive. :type i: int :type j: int :rtype: int
307_range_sum_query_mutable/range_sum_query.py:35
Method
sumRange
sum of elements nums[i..j], inclusive. :type i: int :type j: int :rtype: int
303_range_sum_query_imutable/range_sum_query.py:27
Method
sumRegion
sum of elements matrix[(row1,col1)..(row2,col2)], inclusive. :type row1: int :type col1: int :type row2: int
304_range_sum_query_2d/rangesum.py:25
Method
summaryRanges
(self, nums)
228_summary_ranges/summary_ranges.py:4
Method
swapPairs
:type head: ListNode :rtype: ListNode
024_swap_nodes_in pairs/swap_nodes_in_pairs.py:8
Function
test
()
146_lru_cache/lrucache.py:35
Method
threeSum
:type nums: List[int] :rtype: List[List[int]]
015_three_sum/three_sum.py:2
Method
threeSumClosest
:type nums: List[int] :type target: int :rtype: int
016_three_sum_closest/three_sum_closest.py:4
Method
threeSumSmaller
:type nums: List[int] :type target: int :rtype: int
259_threesum_smaller/3sum_smaller.py:2
Method
titleToNumber
(self, s)
171_excel_sheet_column_number/excel_sheet_column_number.py:4
Method
top
(self)
225_impl_stack_using_queues/stack_using_queues.py:26
Method
top
:rtype: int
225_impl_stack_using_queues/stack_using_queues_take2.py:28
Method
top
(self)
155_min_stack/min_stack.py:28
Method
topKFrequent
:type nums: List[int] :type k: int :rtype: List[int]
347_top_k_frequent_elements/topki_pairing_heap.py:13
Method
totalNQueens
:type n: int :rtype: int
052_n_queens_ii/nqueens_ii.py:2
Method
trailingZeroes
(self, n)
172_factorial_trailing_zeros/factorial_trailing_zeros.py:4
Method
trap
:type height: List[int] :rtype: int
042_trapping_rain_water/trapping_rain_water.py:2
Method
twoSum
:type nums: List[int] :type target: int :rtype: List[int]
001_two_sum/two_sum.py:2
Method
twoSum
:type numbers: List[int] :type target: int :rtype: List[int]
167_two_sum_ii/two_sum_ii.py:2
Method
uniquePaths
:type m: int :type n: int :rtype: int
062_unique_paths/unique_paths.py:2
Method
uniquePathsWithObstacles
:type obstacleGrid: List[List[int]] :rtype: int
063_unique_paths_ii/unique_paths_ii.py:2
Method
upsideDownBinaryTree
:type root: TreeNode :rtype: TreeNode
156_binary_tree_upside_down/binary_tree_upside_down.py:9
Method
validTree
:type n: int :type edges: List[List[int]] :rtype: bool
261_graph_valid_tree/valid_tree.py:2
Method
verifyPreorder
:type preorder: List[int] :rtype: bool
255_verify_preorder_sequence/verify_TLE.py:2
Method
verifyPreorder
(self, preorder)
255_verify_preorder_sequence/verify.py:2
Method
verifyPreorder
:type preorder: List[int] :rtype: bool
255_verify_preorder_sequence/verify_take_2.py:2
Method
verticalOrder
:type root: TreeNode :rtype: List[List[int]]
314_binary_tree_vertical_order_traversal/traversal.py:12
Method
wallsAndGates
:type rooms: List[List[int]] :rtype: void Do not return anything, modify rooms in-place instead.
286_walls_and_gates/walls_and_gates.py:2
Method
wiggleSort
:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.
324_wiggle_sort_ii/wiggle2_TLE2.py:18
Method
wiggleSort
:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.
324_wiggle_sort_ii/wiggle2_TLE.py:2
Method
wiggleSort
:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.
280_wiggle_sort/sort.py:2
Method
wordBreak
(self, s, wordDict)
140_word_break_ii/word_break_ii.py:2
Method
wordBreak
:type s: str :type wordDict: Set[str] :rtype: List[str]
140_word_break_ii/word_break_ii_TLE.py:2
← previous
next →
501–600 of 604, ranked by callers