MCPcopy Create free account

hub / github.com/RealHacker/leetcode-solutions / functions

Functions604 in github.com/RealHacker/leetcode-solutions

MethodproductExceptSelf
(self, nums)
238_product_array/product_of_array_except_self.py:4
Methodpush
(self, x)
225_impl_stack_using_queues/stack_using_queues.py:10
Methodpush
:type x: int :rtype: nothing
225_impl_stack_using_queues/stack_using_queues_take2.py:9
Methodpush
(self, x)
155_min_stack/min_stack.py:9
Methodpush
(self, x)
232_make_queue_using_stacks/queue_using_stacks.py:9
MethodrangeBitwiseAnd
(self, m, n)
201_bitwise_and_of_number_range/bitwise_and_numbers.py:5
Methodread
: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
Methodread
: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
MethodrecoverTree
: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
MethodremoveDuplicateLetters
:type s: str :rtype: str
316_remove_duplicate_letters/remove_duplicate_letters.py:2
MethodremoveDuplicateLetters
:type s: str :rtype: str
316_remove_duplicate_letters/remove_duplicate_letters_TLE.py:4
MethodremoveDuplicates
(self, nums)
026_remove_duplicates_from_sorted_array/remove_duplicates_from_sorted_array.py:5
MethodremoveDuplicates
:type nums: List[int] :rtype: int
080_reemove_duplicates_from_sorted_array_ii/remove_duplicates_from_sorted_array_2.py:2
MethodremoveElement
:type nums: List[int] :type val: int :rtype: int
027_remove_element/remove_element.py:2
MethodremoveElements
(self, head, val)
203_remove_linked_list_elements/remove_linked_list_elements.py:11
MethodremoveNthFromEnd
:type head: ListNode :type n: int :rtype: ListNode
019_remove_nth_node_from_end/remove_nth_node.py:8
MethodreorderList
:type head: ListNode :rtype: void Do not return anything, modify head in-place instead.
143_reorder_list/reoder_list.py:2
MethodreverseBetween
:type head: ListNode :type m: int :type n: int :rtype: ListNode
092_reversed_linked_list_ii/reversed_linked_list.py:8
MethodreverseBits
(self, n)
190_reverse_bits/reverse_bits.py:4
MethodreverseKGroup
(self, head, k)
025_reverse_nodes_in_k_group/reverse_nodes_in_k_group.py:11
MethodreverseList
:type head: ListNode :rtype: ListNode
206_reverse_linked_list/reverse_linked_list.py:7
MethodreverseString
:type s: str :rtype: str
344_reverse_string/reverse.py:2
MethodreverseVowels
:type s: str :rtype: str
345_reverse_vowels/vowels.py:2
MethodreverseWords
:type s: a list of 1 length strings (List[str]) :rtype: nothing
186_reverse_words_in_a_string/reverse.py:2
MethodreverseWords
:type s: str :rtype: str
151_reverse_words_in_a_string/reverse_words_in_string.py:2
MethodrightSideView
(self, root)
199_binary_tree_right_view/binary_tree_rightside_view.py:11
Methodrob
(self, nums)
213_house_robber_ii/house_robber_ii.py:4
Methodrob
(self, nums)
198_house_robber/house_robber.py:4
MethodromanToInt
:type s: str :rtype: int
013_roman_to_integer/roman_to_integer.py:2
Methodrotate
(self, nums, k)
189_rotate_array/rotate_array.py:9
Methodrotate
(self, matrix)
048_rotate_image/rotate_image.py:7
MethodrotateRight
:type head: ListNode :type k: int :rtype: ListNode
061_rotate_list/rotate_list.py:2
Methodsearch
(self, nums, target)
081_search_in_rotated_sorted_array/search_in_rotated_sorted.py:2
Methodsearch
(self, word)
211_add_and_search_word/add_and_search_ds.py:23
Methodsearch
(self, word)
208_implement_trie/implement_trie_prefix_tree.py:26
MethodsearchInsert
:type nums: List[int] :type target: int :rtype: int
035_search_insert_position/search_insert_position.py:2
MethodsearchMatrix
(self, matrix, target)
074_search_2d_matrix/search_2d_matrix.py:6
MethodsearchMatrix
(self, matrix, target)
240_search_2d_matrix/search_2d_matrix_ii.py:6
MethodsearchMatrix
:type matrix: List[List[int]] :type target: int :rtype: bool
240_search_2d_matrix/search_2d_matrix_ii_take2.py:2
MethodsearchRange
(self, nums, target)
034_search_for_a_range/search_for_range.py:6
Methodserialize
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
Methodserialize
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
MethodsetZeroes
: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
Methodshortest
Adds a word into the data structure. :type word1: str :type word2: str :rtype: int
244_shortest_word_distance_ii/shortest.py:14
MethodshortestDistance
:type grid: List[List[int]] :rtype: int
317_shortest_distance_from_all_buildings/shortest_distance.py:2
MethodshortestDistance
:type words: List[str] :type word1: str :type word2: str :rtype: int
243_shortest_word_distance/shortest.py:2
MethodshortestWordDistance
:type words: List[str] :type word1: str :type word2: str :rtype: int
245_shortest_word_distance_iii/shortest.py:2
MethodsimplifyPath
:type path: str :rtype: str
071_simplify_path/simplify_path.py:2
MethodsingleNumber
:type nums: List[int] :rtype: List[int]
260_single_number_iii/single_number_iii.py:2
MethodsingleNumber
(self, nums)
137_single_number_ii/single_numbe_ii.py:4
MethodsingleNumber
:type nums: List[int] :rtype: int
137_single_number_ii/single_number_ii.py:2
MethodsingleNumber
:type nums: List[int] :rtype: int
136_single_number/single_number.py:2
Methodsolve
(self, board)
130_surrounded_regions/surrounded_regions.py:4
Methodsolve
(self, board)
130_surrounded_regions/surrounded_regions_TLE.py:4
MethodsolveNQueens
:type n: int :rtype: List[List[str]]
051_n_queens/n_queens.py:2
MethodsolveSudoku
:type board: List[List[str]] :rtype: void Do not return anything, modify board in-place instead.
037_sodoku_solver/sodoku_solver.py:2
FunctionsortColors
(self, nums)
075_sort_colors/sort_colors_swap.py:1
MethodsortColors
(self, nums)
075_sort_colors/sort_colors.py:7
MethodsortedArrayToBST
:type nums: List[int] :rtype: TreeNode
108_sorted_array_to_bst/sorted_array_to_bst.py:9
MethodsortedListToBST
:type head: ListNode :rtype: TreeNode
109_convert_sorted_list_to_BST/convert_sorted_list_to_BST.py:2
MethodspiralOrder
:type matrix: List[List[int]] :rtype: List[int]
054_spiral_matrix/spiral_matrix.py:2
MethodstartsWith
(self, prefix)
208_implement_trie/implement_trie_prefix_tree.py:38
MethodstrStr
:type haystack: str :type needle: str :rtype: int
028_implement_strstr/strstr.py:2
MethodstrobogrammaticInRange
:type low: str :type high: str :rtype: int
248_strobogrammatic_number_iii/strobo.py:2
Methodsubsets
:type nums: List[int] :rtype: List[List[int]]
078_subsets/subsets.py:3
MethodsubsetsWithDup
:type nums: List[int] :rtype: List[List[int]]
090_subsets_ii/subsets_ii.py:2
MethodsumNumbers
(self, root)
129_sum_root_to_leaf/sum_root_to_leaf.py:11
MethodsumRange
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
MethodsumRange
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
MethodsumRegion
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
MethodsummaryRanges
(self, nums)
228_summary_ranges/summary_ranges.py:4
MethodswapPairs
:type head: ListNode :rtype: ListNode
024_swap_nodes_in pairs/swap_nodes_in_pairs.py:8
Functiontest
()
146_lru_cache/lrucache.py:35
MethodthreeSum
:type nums: List[int] :rtype: List[List[int]]
015_three_sum/three_sum.py:2
MethodthreeSumClosest
:type nums: List[int] :type target: int :rtype: int
016_three_sum_closest/three_sum_closest.py:4
MethodthreeSumSmaller
:type nums: List[int] :type target: int :rtype: int
259_threesum_smaller/3sum_smaller.py:2
MethodtitleToNumber
(self, s)
171_excel_sheet_column_number/excel_sheet_column_number.py:4
Methodtop
(self)
225_impl_stack_using_queues/stack_using_queues.py:26
Methodtop
:rtype: int
225_impl_stack_using_queues/stack_using_queues_take2.py:28
Methodtop
(self)
155_min_stack/min_stack.py:28
MethodtopKFrequent
:type nums: List[int] :type k: int :rtype: List[int]
347_top_k_frequent_elements/topki_pairing_heap.py:13
MethodtotalNQueens
:type n: int :rtype: int
052_n_queens_ii/nqueens_ii.py:2
MethodtrailingZeroes
(self, n)
172_factorial_trailing_zeros/factorial_trailing_zeros.py:4
Methodtrap
:type height: List[int] :rtype: int
042_trapping_rain_water/trapping_rain_water.py:2
MethodtwoSum
:type nums: List[int] :type target: int :rtype: List[int]
001_two_sum/two_sum.py:2
MethodtwoSum
:type numbers: List[int] :type target: int :rtype: List[int]
167_two_sum_ii/two_sum_ii.py:2
MethoduniquePaths
:type m: int :type n: int :rtype: int
062_unique_paths/unique_paths.py:2
MethoduniquePathsWithObstacles
:type obstacleGrid: List[List[int]] :rtype: int
063_unique_paths_ii/unique_paths_ii.py:2
MethodupsideDownBinaryTree
:type root: TreeNode :rtype: TreeNode
156_binary_tree_upside_down/binary_tree_upside_down.py:9
MethodvalidTree
:type n: int :type edges: List[List[int]] :rtype: bool
261_graph_valid_tree/valid_tree.py:2
MethodverifyPreorder
:type preorder: List[int] :rtype: bool
255_verify_preorder_sequence/verify_TLE.py:2
MethodverifyPreorder
(self, preorder)
255_verify_preorder_sequence/verify.py:2
MethodverifyPreorder
:type preorder: List[int] :rtype: bool
255_verify_preorder_sequence/verify_take_2.py:2
MethodverticalOrder
:type root: TreeNode :rtype: List[List[int]]
314_binary_tree_vertical_order_traversal/traversal.py:12
MethodwallsAndGates
: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
MethodwiggleSort
:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.
324_wiggle_sort_ii/wiggle2_TLE2.py:18
MethodwiggleSort
:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.
324_wiggle_sort_ii/wiggle2_TLE.py:2
MethodwiggleSort
:type nums: List[int] :rtype: void Do not return anything, modify nums in-place instead.
280_wiggle_sort/sort.py:2
MethodwordBreak
(self, s, wordDict)
140_word_break_ii/word_break_ii.py:2
MethodwordBreak
:type s: str :type wordDict: Set[str] :rtype: List[str]
140_word_break_ii/word_break_ii_TLE.py:2
← previousnext →501–600 of 604, ranked by callers