MCPcopy Create free account

hub / github.com/austingebauer/go-leetcode / functions

Functions430 in github.com/austingebauer/go-leetcode

↓ 44 callersMethodMove
** Player {player} makes a move at ({row}, {col}). @param row The row of the board. @param col The column of the board. @param player The player
design_tic_tac_toe_348/solution.go:28
↓ 27 callersMethodGet
(key int)
lru_cache_146/solution.go:71
↓ 25 callersMethodPut
(key int, value int)
lru_cache_146/solution.go:28
↓ 12 callersFunctionNewNestedInteger
(value any)
flatten_nested_list_iterator_341/solution.go:34
↓ 8 callersMethodAddNum
(num int)
find_median_from_data_stream_295/solution.go:68
↓ 8 callersFunctionConstructor
(capacity int)
lru_cache_146/solution.go:21
↓ 8 callersMethodFindMedian
()
find_median_from_data_stream_295/solution.go:83
↓ 8 callersFunctionwaterCanFlow
(matrix [][]int, pr, pc, ro, co, rd, cd int)
pacific_atlantic_water_flow_417/solution.go:164
↓ 7 callersFunctionConstructor
** Initialize your data structure here. */
design_tic_tac_toe_348/solution.go:13
↓ 6 callersFunctionbinarySearch
(nums []int, target, start, end int)
search_in_rotated_sorted_array_33/solution.go:59
↓ 5 callersMethodGet
(key string, timestamp int)
time_based_key_value_store_981/solution.go:45
↓ 4 callersMethodLen
()
find_median_from_data_stream_295/solution.go:7
↓ 4 callersMethodNext
(val int)
moving_average_from_data_stream_346/solution.go:18
↓ 4 callersFunctionexplore
(matrix [][]int, visited *[][]bool, prev, r, c int)
pacific_atlantic_water_flow_417/solution.go:52
↓ 3 callersMethodPeek
()
flatten_nested_list_iterator_341/solution.go:80
↓ 3 callersMethodPush
(x interface{})
find_median_from_data_stream_295/solution.go:16
↓ 3 callersMethodPush
(x int)
min_stack_155/solution.go:17
↓ 3 callersMethodSearch
Returns true if the word is in the trie
implement_trie_208/solution.go:42
↓ 3 callersFunctionhasCycle
Time: O(n) Space: O(1)
linked_list_cycle_141/solution.go:7
↓ 3 callersFunctionmergeTwoLists
(l1 *ListNode, l2 *ListNode)
merge_k_sorted_lists_23/solution.go:71
↓ 3 callersFunctionreachedAtlantic
(matrix [][]int, r, c int)
pacific_atlantic_water_flow_417/solution.go:156
↓ 3 callersFunctionreachedPacific
(r, c int)
pacific_atlantic_water_flow_417/solution.go:160
↓ 2 callersFunctionConstructor
** initialize your data structure here. */
find_median_from_data_stream_295/solution.go:56
↓ 2 callersMethodGetMin
()
min_stack_155/solution.go:68
↓ 2 callersMethodPop
()
find_median_from_data_stream_295/solution.go:19
↓ 2 callersMethodPush
(v *ListIndex)
flatten_nested_list_iterator_341/solution.go:66
↓ 2 callersMethodSet
(key string, value string, timestamp int)
time_based_key_value_store_981/solution.go:20
↓ 2 callersMethodbringNodeToFront
(node *LRUNode)
lru_cache_146/solution.go:92
↓ 2 callersFunctiondepthFirstNum
(l *structures.ListNode)
add_two_numbers_2/solution.go:50
↓ 2 callersFunctionexpandAroundCenter
(s string, left int, right int)
longest_palindromic_substring_5/solution.go:99
↓ 2 callersFunctionexpandCenter
expandCenter returns the number of palindromic strings discovered by expanding around the passed left and right index in the passed string s.
palindromic_substrings_647/solution.go:18
↓ 2 callersFunctionexpandLeft
(s string, kl int, left int, pick int)
longest_repeating_character_replacement_424/solution.go:68
↓ 2 callersFunctionexpandPalindrome
(s string, i, j int)
longest_palindromic_substring_5/solution.go:24
↓ 2 callersFunctionexpandRight
(s string, kr int, right int, pick int)
longest_repeating_character_replacement_424/solution.go:81
↓ 2 callersFunctionfindNodeBST
Assumes the passed tree is a BST, has all unique values, and v is in the tree
lowest_common_ancestor_of_a_binary_search_tree_235/solution_test.go:124
↓ 2 callersFunctionfrequencyOfSmallestChar
(s string)
compare_strings_by_frequency_of_the_smallest_character_1170/solution.go:33
↓ 2 callersFunctiongetPointsForT
(t, lower, upper int)
diet_plan_performance_1176/solution.go:25
↓ 2 callersFunctionhasZeros
(n int)
convert_integer_to_the_sum_of_two_no_zero_integers/solution.go:15
↓ 2 callersMethodinsertInFront
(node *LRUNode)
lru_cache_146/solution.go:86
↓ 2 callersFunctionisAlphaNumeric
(s string)
valid_palindrome_125/solution.go:34
↓ 2 callersFunctionisIncreasing
(nums []int)
longest_increasing_subsequence_300/solution.go:124
↓ 2 callersFunctionisOutOfBounds
(m [][]int, r, c int)
spiral_matrix_54/solution.go:52
↓ 2 callersFunctionlength
(n *ListNode)
intersection_of_two_linked_lists_160/solution.go:44
↓ 2 callersFunctionrobInRange
(nums []int)
house_robber_ii_213/solution.go:22
↓ 2 callersMethodsearch
(word string, needsEnd bool)
implement_trie_208/solution.go:51
↓ 2 callersFunctionsetDifference
(s1, s2 map[int]struct{})
find_the_difference_of_two_arrays_2215/solution.go:12
↓ 2 callersFunctionsliceToSet
(a []int)
find_the_difference_of_two_arrays_2215/solution.go:23
↓ 1 callersFunctionConstructor
Returns a Trie
implement_trie_208/solution.go:14
↓ 1 callersFunctionConstructor
** Initialize your data structure here. */
moving_average_from_data_stream_346/solution.go:10
↓ 1 callersFunctionConstructor
(nestedList []*NestedInteger)
flatten_nested_list_iterator_341/solution.go:96
↓ 1 callersFunctionConstructor
()
min_stack_155/solution.go:13
↓ 1 callersFunctionConstructor
()
time_based_key_value_store_981/solution.go:14
↓ 1 callersMethodDecode
Decodes a single string to a list of strings.
encode_and_decode_strings_271/solution.go:24
↓ 1 callersMethodEncode
Encodes a list of strings to a single string.
encode_and_decode_strings_271/solution.go:13
↓ 1 callersMethodGetInteger
()
flatten_nested_list_iterator_341/solution.go:48
↓ 1 callersMethodGetList
()
flatten_nested_list_iterator_341/solution.go:52
↓ 1 callersMethodHasNext
()
flatten_nested_list_iterator_341/solution.go:131
↓ 1 callersMethodInsert
Inserts a word into the trie
implement_trie_208/solution.go:21
↓ 1 callersMethodIsEmpty
()
flatten_nested_list_iterator_341/solution.go:88
↓ 1 callersMethodIsInteger
()
flatten_nested_list_iterator_341/solution.go:45
↓ 1 callersMethodNext
()
flatten_nested_list_iterator_341/solution.go:108
↓ 1 callersMethodPop
()
flatten_nested_list_iterator_341/solution.go:70
↓ 1 callersMethodPop
()
min_stack_155/solution.go:37
↓ 1 callersMethodPop
()
top_k_frequent_elements_347/solution.go:24
↓ 1 callersMethodPush
(f interface{})
top_k_frequent_elements_347/solution.go:21
↓ 1 callersMethodStartsWith
Returns true if there is any word in the trie that starts with the given prefix
implement_trie_208/solution.go:47
↓ 1 callersMethodTop
()
min_stack_155/solution.go:64
↓ 1 callersFunctionaddTwoNumbers
(l1 *structures.ListNode, l2 *structures.ListNode)
add_two_numbers_2/solution.go:8
↓ 1 callersFunctionaddTwoNumbers2
(l1 *structures.ListNode, l2 *structures.ListNode)
add_two_numbers_2/solution.go:59
↓ 1 callersFunctionalienOrder
(words []string)
alien_dictionary_269/solution.go:8
↓ 1 callersFunctionbt
(preorder []int, inorder []int)
construct_binary_tree_from_preorder_and_inorder_traversal_105/solution.go:38
↓ 1 callersFunctionbuildTree
(preorder []int, inorder []int)
construct_binary_tree_from_preorder_and_inorder_traversal_105/solution.go:5
↓ 1 callersFunctioncanAttendMeetings
(intervals [][]int)
meeting_rooms_252/solution.go:5
↓ 1 callersFunctioncanFinishBFS
Note: study again. BFS cycle detection based on topological sorting (Kahn’s algorithm). If we don't visit every vertex in the topological sort, then w
course_schedule_207/solution.go:8
↓ 1 callersFunctioncanFinishDFS
DFS cycle detection based on coloring the recursive path as "in progress" or not. If we get back to an "in progress" vertex, it's a part of a cycle.
course_schedule_207/solution.go:65
↓ 1 callersFunctioncanPartitionKSubsets
Note: study again. Good problem!
partition_to_k_equal_sum_subsets_698/solution.go:6
↓ 1 callersFunctioncanReachAtlantic
(matrix [][]int, r, c, pr, pc int)
pacific_atlantic_water_flow_417/solution.go:120
↓ 1 callersFunctioncanReachPacific
(matrix [][]int, r, c, pr, pc int)
pacific_atlantic_water_flow_417/solution.go:84
↓ 1 callersFunctioncharacterReplacement
(s string, k int)
longest_repeating_character_replacement_424/solution.go:5
↓ 1 callersFunctionclimbStairs
(n int)
climbing_stairs_70/solution.go:3
↓ 1 callersFunctioncoinChange
Version 3: Bottom-up approach using filled slice with one above amount, which is one above max in scenario with denomination 1 * amount.
coin_change_322/solution.go:7
↓ 1 callersFunctioncombinationSum4
(nums []int, target int)
combination_sum_iv_377/solution.go:3
↓ 1 callersFunctioncompareAlienStrings
Returns -1 if s1 < s2, 0 if s1 == s2, and 1 if s1 > s2
verifying_an_alien_dictionary_953/solution.go:19
↓ 1 callersFunctioncompareLogs
(a, b string)
reorder_data_in_log_files_937/solution.go:32
↓ 1 callersFunctioncontainsDuplicate
(nums []int)
contains_duplicate_217/solution.go:3
↓ 1 callersFunctioncountAndSay
(n int)
count_and_say_38/solution.go:5
↓ 1 callersFunctioncountBits
(num int)
counting_bits_338/solution.go:3
↓ 1 callersFunctioncountSubstrings
(s string)
palindromic_substrings_647/solution.go:3
↓ 1 callersFunctioncriticalConnections
Note: review this. Good graph algorithm. Finding bridges in graph: https://www.youtube.com/watch?v=thLQYBlz2DM A bridge is a connection that is critic
critical_connections_in_a_network_1192/solution.go:12
↓ 1 callersFunctiondeleteNode
** * Definition for singly-linked list. * type ListNode struct { * Val int * Next *ListNode * } */
delete_node_in_a_linked_list_237/solution.go:12
↓ 1 callersFunctiondf
(curr *ListNode, n int)
remove_nth_node_from_end_of_list_19/solution.go:16
↓ 1 callersFunctiondfs
(node int, adjList map[int][]int, disc, low, parents []int, time int, critical [][]int)
critical_connections_in_a_network_1192/solution.go:37
↓ 1 callersFunctiondietPlanPerformance
(calories []int, k int, lower int, upper int)
diet_plan_performance_1176/solution.go:3
↓ 1 callersFunctiondistributeCandies
(candies []int)
distribute_candies_575/solution.go:5
↓ 1 callersFunctionencodeString
(s string)
group_anagrams_49/solution.go:27
↓ 1 callersFunctionequalTrees
(t1, t2 *TreeNode)
subtree_of_another_tree_572/solution.go:25
↓ 1 callersFunctioneraseOverlapHelper
(intervals [][]int, count int)
non_overlapping_intervals_435/solution.go:58
↓ 1 callersFunctioneraseOverlapIntervals
DP solution based on sorting by start times. Almost identical solution to longest_increasing_subsequence_300, where dp[i] stores the max (longest) we
non_overlapping_intervals_435/solution.go:13
↓ 1 callersFunctionexist
Time: O(N * 4^(L (len of word))) Space: O(L) recursion stack at most L
word_search_79/solution.go:9
↓ 1 callersFunctionexplore
(board [][]byte, word string, step, r, c int)
word_search_79/solution.go:21
next →1–100 of 430, ranked by callers