MCPcopy Create free account

hub / github.com/bwiens/leetcode-python / functions

Functions440 in github.com/bwiens/leetcode-python

Method__init__
initialize your data structure here.
find_median_from_data_stream.py:3
Method__init__
(self)
number_of_recent_calls.py:7
Method__init__
Initialize your data structure here.
design_hit_counter.py:6
Method__init__
Initialize your data structure here.
time_based_key_value_store.py:6
Method__init__
(self)
design_a_leaderboard.py:7
MethodaddNum
(self, num: int)
find_median_from_data_stream.py:10
MethodaddScore
(self, playerId: int, score: int)
design_a_leaderboard.py:10
MethodaddTwoNumbers
(self, l1: ListNode, l2: ListNode)
add_two_numbers.py:10
MethodaverageOfLevels
:type root: TreeNode :rtype: List[float]
average_of_levels_in_binary_tree.py:13
Methodbacktrack
(s, left, right)
generate_parentheses.py:19
MethodbinaryTreePaths
(self, root: TreeNode)
binary_tree_paths.py:5
MethodbstToGst
(self, root: TreeNode)
binary_search_tree_to_greater_sum_tree.py:5
MethodcanAttendMeetings
:type intervals: List[Interval] :rtype: bool
meeting_rooms.py:12
MethodcloneGraph
(self, node: 'Node')
clone_graph.py:10
MethodclosestValue
(self, root: TreeNode, target: float)
closest_binary_search_tree_value.py:6
Methodconnect
(self, root: 'Node')
populating_next_right_pointers_in_each_node_ii.py:14
Methodconnect
(self, root: 'Node')
populating_next_right_pointers_in_each_node.py:15
MethodconstructMaximumBinaryTree
(self, nums: List[int])
maximum_binary_tree.py:12
MethodcopyRandomList
(self, head: 'Node')
copy_list_with_random_pointer.py:13
MethodcountI
(rid, cid, grid)
number_of_closed_islands.py:8
MethodcountMatches
(word1, word2)
guess_the_word.py:10
MethodcountNodes
(self, root: TreeNode)
count_complete_tree_nodes.py:11
Methodcount_neighbors
(rindex, cindex, count)
max_area_of_island.py:17
Methodcrawl
(self, startUrl: str, htmlParser: 'HtmlParser')
web_crawler.py:16
MethoddeQueue
Delete an element from the circular queue. Return true if the operation is successful.
design_circular_queue.py:23
MethoddeepestLeavesSum
(self, root: TreeNode)
deepest_leaves_sum.py:6
MethoddelNodes
:type root: TreeNode :type to_delete: List[int] :rtype: List[TreeNode]
delete_nodes_and_return_forest.py:3
MethoddeleteDuplicates
(self, head: ListNode)
remove_duplicates_from_sorted_list.py:10
MethoddeleteNode
:type node: ListNode :rtype: void Do not return anything, modify node in-place instead.
delete_node_in_a_linked_list.py:12
MethoddepthSum
(self, nestedList: List[NestedInteger])
nested_list_weight.py:48
Methoddepthvisit
(nestedList, depth)
nested_list_weight.py:49
Methoddeserialize
(self, data)
serialize_and_deserialize_binary_tree.py:33
MethoddetectCycle
(self, head: ListNode)
linked_list_cycle_ii.py:11
Methoddfs
(node)
range_sum_of_bst.py:15
Methoddfs
(rid, cid, word, visited, found)
word_search.py:15
Methoddfs
(root)
find_leaves_of_binary_tree.py:3
MethodenQueue
Insert an element into the circular queue. Return true if the operation is successful.
design_circular_queue.py:14
MethodfindBottomLeftValue
(self, root: TreeNode)
find_bottom_left_tree_value.py:14
MethodfindGold
(rid, cid, sum)
path_with_maximum_gold.py:11
MethodfindLeaves
(self, root: TreeNode)
find_leaves_of_binary_tree.py:2
MethodfindMedian
(self)
find_median_from_data_stream.py:13
MethodfindSecretWord
(self, wordlist: List[str], master: 'Master')
guess_the_word.py:8
MethodfindSolution
(self, customfunction, z)
find_positive_integer_solution_for_a_given_equation.py:6
MethodfirstBadVersion
:type n: int :rtype: int
first_bad_version.py:12
Methodflatten
(self, head: 'Node')
flatten_a_multilevel_doubly_linked_list.py:14
Methodget
(self, key: str, timestamp: int)
time_based_key_value_store.py:19
MethodgetHits
Return the number of hits in the past 5 minutes. @param timestamp - The current timestamp (in seconds granularity).
design_hit_counter.py:24
MethodgetIntersectionNode
:type head1, head1: ListNode :rtype: ListNode
intersection_of_two_linked_lists.py:11
MethodgetMin
(self)
min_stack_v2.py:31
MethodgetMinimumDifference
(self, root: TreeNode)
minimum_absolute_difference_in_bst.py:15
MethodgetRandom
Get a random element from the set.
insert_delete_getrandom_o1.py:36
MethodguessNumber
:type n: int :rtype: int
guess_number_higher_or_lower.py:7
MethodhasCycle
:type head: ListNode :rtype: bool
linked_list_cycle.py:12
MethodhasPathSum
(self, root: TreeNode, sum: int)
path_sum.py:13
Methodhelper
(N)
fibonacci_number.py:11
Methodhit
Record a hit. @param timestamp - The current timestamp (in seconds granularity).
design_hit_counter.py:13
Methodinsert
Inserts a value to the set. Returns true if the set did not already contain the specified element.
insert_delete_getrandom_o1.py:14
MethodinsertIntoBST
(self, root: TreeNode, val: int)
insert_into_a_binary_search_tree.py:12
MethodinvertTree
(self, root)
invert_binary_tree.py:9
MethodisEmpty
Checks whether the circular queue is empty or not.
design_circular_queue.py:49
MethodisFull
Checks whether the circular queue is full or not.
design_circular_queue.py:58
MethodisPalindrome
(self, head: ListNode)
palindrome_linked_list.py:12
MethodisSameTree
(self, p: TreeNode, q: TreeNode)
same_tree.py:7
MethodisSubtree
(self, s: TreeNode, t: TreeNode)
subtree_of_another_tree.py:14
MethodisSymmetric
(self, root: TreeNode)
symmetric_tree.py:11
MethodisUnivalTree
(self, root: TreeNode)
univalued_binary_tree.py:13
MethodlargestValues
(self, root: TreeNode)
find_largest_value_in_each_tree_row.py:15
MethodleafSimilar
(self, root1, root2)
leaf_similar_trees.py:5
MethodleftMostColumnWithOne
(self, binaryMatrix: 'BinaryMatrix')
leftmost_column_with_at_least_a_one.py:2
MethodlevelOrder
:type root: TreeNode :rtype: List[List[int]]
binary_tree_level_order_traversal.py:14
MethodlevelOrder
(self, root: 'Node')
n-ary-tree-level-order_traversal.py:13
MethodlevelOrderBottom
:type root: TreeNode :rtype: List[List[int]]
binary_tree_level_order_traversal_ii.py:13
MethodlowestCommonAncestor
(self, root: 'TreeNode', p: 'TreeNode', q: 'TreeNode')
lowest_common_ancestor_of_a_binary_search_tree.py:12
MethodmaxDepth
(self, root: 'Node')
maximum_depth_of_n-ary-tree.py:13
MethodmaxDepth
(self, root: TreeNode)
maximum_depth_of_binary_tree.py:13
MethodmaxLevelSum
(self, root: TreeNode)
maximum_level_sum_of_a_binary_tree.py:12
MethodmergeKLists
(self, lists: List[ListNode])
merge_k_sorted_lists.py:8
MethodmergeTrees
(self, t1: TreeNode, t2: TreeNode)
merge_two_binary_trees.py:13
MethodmiddleNode
(self, head: ListNode)
bt_ll_traversal_examples.py:33
MethodmiddleNode
(self, head: ListNode)
middle_of_the_linked_list.py:13
MethodminDepth
(self, root: TreeNode)
minimum_depth_of_a_binary_tree.py:12
MethodnumComponents
(self, head: ListNode, G: List[int])
linked_list_components.py:11
MethodnumUniqueEmails
:type emails: List[str] :rtype: int
unique_email_addresses_2.py:9
MethododdEvenList
(self, head: ListNode)
odd_even_linked_list.py:13
MethodpathSum
(self, root: TreeNode, sum: int)
path_sum_ii.py:13
Methodpeek
Returns the next element in the iteration without advancing the iterator. :rtype: int
peeking_iterator.py:31
MethodpeekMax
(self)
max_stack.py:23
Methodpermute
(self, nums: 'List[int]')
permutations.py:20
Methodping
(self, t: int)
number_of_recent_calls.py:10
MethodplusOne
(self, head: ListNode)
plus_one_linked_list.py:6
Functionpop
(stack)
stack.py:35
Methodpop
(self)
min_stack_v2.py:21
Methodpop
(self)
max_stack.py:16
MethodpopMax
(self)
max_stack.py:26
Methodpossible
(x)
divide_chocolate.py:10
Methodpostorder
(self, root: 'Node')
n-ary-tree-postorder_traversal.py:11
Methodpreorder
(self, root: 'Node')
n-ary-tree-preorder_traversal.py:12
Methodpush
(self, x: int)
min_stack_v2.py:13
Methodpush
(self, x: int)
max_stack.py:13
MethodrangeSumBST
(self, root: TreeNode, L: int, R: int)
bt_ll_traversal_examples.py:4
← previousnext →301–400 of 440, ranked by callers