MCPcopy Create free account

hub / github.com/Hsinha11/Leetcode-solutions / functions

Functions798 in github.com/Hsinha11/Leetcode-solutions

↓ 28 callersMethodget
(self, index: int)
838-design-linked-list/design-linked-list.py:6
↓ 13 callersFunctionbacktrack
(temp, remain, start)
39-combination-sum/combination-sum.js:11
↓ 12 callersMethodcount
-410-split-array-largest-sum/-410-split-array-largest-sum.cpp:20
↓ 10 callersMethodmoveZeroes
Move all zeros to the end while maintaining relative order of non-zeros. Modifies array in-place. Args:
283-move-zeroes/move-zeroes.py:20
↓ 10 callersMethodremove
(self, val: int)
381-insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed.py:19
↓ 9 callersFunctiondfs
(i, j, index)
79-word-search/word-search.js:12
↓ 9 callersFunctiondfs
(heights, visited, height, x, y)
417-pacific-atlantic-water-flow/pacific-atlantic-water-flow.js:40
↓ 9 callersFunctiondfs
(original)
133-clone-graph/clone-graph.js:20
↓ 8 callersMethodfind
MinimizeHammingDistance/MinimizeHammingDistance.cpp:15
↓ 6 callersMethodlongestSubarray
1493. Longest Subarray of 1's After Deleting One Element/longest-subarray-of-1s-after-deleting-one-element.cpp:7
↓ 6 callersMethodremoveDuplicates
Remove duplicates from sorted array in-place. Args: nums: A sorted list of integers in non-decreasing order
26-remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.py:20
↓ 5 callersMethodfind
1202-smallest-string-with-swaps/1202-smallest-string-with-swaps.cpp:19
↓ 4 callersFunctiondfs
3704-count-no-zero-pairs-that-sum-to-n/3704-count-no-zero-pairs-that-sum-to-n.cpp:37
↓ 4 callersFunctiondfs
(node, path, s)
-113-Path-Sum-II/Path-Sum-II.py:3
↓ 4 callersMethoddfs
(int[][] heights, boolean[][] visited, int height, int x, int y)
417-pacific-atlantic-water-flow/pacific-atlantic-water-flow.java:39
↓ 4 callersMethoddfs
(self, heights: List[List[int]], visited: List[List[bool]], height: int, x: int, y: int)
417-pacific-atlantic-water-flow/pacific-atlantic-water-flow.py:34
↓ 4 callersMethodisEmpty
Function to check if the deque is empty
641-design-circular-deque/design-circular-deque.cpp:106
↓ 4 callersMethodisRobotBounded
(self, instructions)
1041-Robot-Bounded-In-Circle/Robot_bounded_in_circle.py:2
↓ 4 callersMethodis_valid_account
(self, account: int)
2169-simple-bank-system/simple-bank-system.py:7
↓ 4 callersMethodlargestOddNumber
Find the largest odd number that is a substring of the given string. Args: num: String representing a large inte
1903-largest-odd-number-in-string/largest-odd-number-in-string.py:16
↓ 4 callersFunctionprintVector
189-Rotate-Array/189_Rotate_Array.cpp:22
↓ 4 callersMethodrotate
189-Rotate-Array/189_Rotate_Array.cpp:7
↓ 3 callersFunctionbacktrack
(start, seen)
1593. Split a String Into the Max Number of Unique Substrings/split-a-string-I-to-the-max-number-of-unique-substrings.py:2
↓ 3 callersFunctiondfs
(grid, i, j)
200-number-of-islands/number-of-islands.js:26
↓ 3 callersMethodinsert
(self, inter: List[List[int]], new: List[int])
57-insert-interval/insert-interval.py:2
↓ 3 callersMethodisPalindrome
(self, x: int)
9-Palindrome-Number/Palindrome-Number.py:2
↓ 3 callersMethodlengthOfLongestSubstring
3-Longest-Substring-Without-Repeating-Characters/Solution.cpp:6
↓ 3 callersMethodlengthOfLongestSubstring
(String s)
3-Longest-Substring-Without-Repeating-Characters/Solution.java:4
↓ 3 callersMethodmaxPower
2528-Maximize-the-Minimum-Powered-City/2528-Maximize-the-Minimum-Powered-City.cpp:8
↓ 3 callersMethodmaxProfit
(self, prices: List[int])
123-best-time-to-buy-and-sell-stock-iii/best-time-to-buy-and-sell-stock-iii.py:5
↓ 3 callersMethodmaxSlidingWindow
(self, nums, k)
239-Sliding-Window-Maximum/Sliding_window_maximum.py:4
↓ 3 callersFunctionreverse
-7-Reverse-Integer/-7-Reverse_Integer.c:3
↓ 3 callersMethodreverse
369-plus-one-linked-list/369-plus-one-linked-list.cpp:16
↓ 3 callersMethodtopKFrequent
(self, words, k)
692-Top-K-Frequent-Words/Top_K_Frequent_Words.py:5
↓ 2 callersMethodaddSpaces
(StringBuilder str, int count)
-68-Text_Justification/Code.java:5
↓ 2 callersFunctionadd_spaces
(s, count)
-68-Text_Justification/Code.py:1
↓ 2 callersMethodcalculate_partial_garden_beauty
(self, flowers_needed, newFlowers, flowers, target, partial, ind)
2234-Maximum-Total-Beauty-of-the-Gardens/Maximum-Total-Beauty-of-the-Gardens.py:47
↓ 2 callersMethodcount_upto
2719-count-of-integers/2719-count-of-integers.cpp:39
↓ 2 callersMethoddepth
(self,root)
110-balanced-binary-tree/balanced-binary-tree.py:8
↓ 2 callersFunctionexpand
(s, left, right)
647-palindromic-substrings/palindromic-substrings.js:20
↓ 2 callersMethodexpand
(self, s: str, left: int, right: int)
647-palindromic-substrings/palindromic-substrings.py:15
↓ 2 callersMethodexpandAroundCenter
(String s, int left, int right)
647-palindromic-substrings/palindromic-substrings.java:17
↓ 2 callersMethodfindMissingAndRepeatedValues
Find the repeated and missing values in a 2D grid. Args: grid: 2D integer matrix of size n x n with values in ra
2965-Find_Missing_And_Repeated_Value/find-missing-and-repeated-values.py:17
↓ 2 callersMethodgather
gather
2286-booking-concert-tickets-in-groups/2286-booking-concert-tickets-in-groups.cpp:88
↓ 2 callersMethodinsert
(self, val: int)
381-insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed.py:9
↓ 2 callersMethodis_prime
(self,n: int)
4100-complete-prime-number/complete-prime-number.py:2
↓ 2 callersMethodisdigit
420-strong-password-checker/strong-password-checker.cpp:33
↓ 2 callersMethodmaxFrequency
3347-maximum-frequency-of-an-element-after-performing-operations-ii/3347-maximum-frequency-of-an-element-after-performing-operations-ii.cpp:16
↓ 2 callersMethodmaxPalindromes
2472-maximum-number-of-non-overlapping-palindrome-substrings/2472-maximum-number-of-non-overlapping-palindrome-substrings.cpp:22
↓ 2 callersMethodmaxPower
(self, stations: List[int], r: int, k: int)
2528-Maximize-the-Minimum-Powered-City/2528-Maximize-the-Minimum-Powered-City.py:4
↓ 2 callersMethodmaximumTotalSubarrayValueII
Public API matching LeetCode problem
3691-maximum-total-subarray-value-ii/3691-maximum-total-subarray-value-ii.cpp:97
↓ 2 callersMethodminIncrementForUnique
Make all elements in the array unique by incrementing duplicates. Strategy: 1. Sort the array to process elements in
945-minimum-increment-to-make-array-unique/minimum-increment-to-make-array-unique.py:11
↓ 2 callersMethodminOperations
(self, boxes: str)
1895-minimum-number-of-operations-to-move-all-balls-to-each-box/minimum-number-of-operations-to-move-all-balls-to-each-box.py:5
↓ 2 callersMethodpow_mod
(self,a, b)
372-super-pow/super-pow.py:2
↓ 2 callersFunctionpush
(node)
23-merge-k-sorted-lists/merge-k-sorted-lists.js:20
↓ 2 callersFunctionrobLinear
(nums, start, end)
213-house-robber-ii/house-robber-ii.js:19
↓ 2 callersMethodrobLinear
(int[] nums, int start, int end)
213-house-robber-ii/house-robber-ii.java:16
↓ 2 callersMethodrob_linear
(self, nums: List[int], start: int, end: int)
213-house-robber-ii/house-robber-ii.py:19
↓ 2 callersMethodscatter
scatter
2286-booking-concert-tickets-in-groups/2286-booking-concert-tickets-in-groups.cpp:101
↓ 1 callersMethodLRA
(self, heights: list[int])
85-maximal-rectangle/maximal-rectangle.py:2
↓ 1 callersMethod_find_kth
(self, node: 'ListNode', k: int)
25. Reverse Nodes in k-Group/Solution.py:47
↓ 1 callersMethod_is_valid_cell
(self, row, col, num_of_rows, num_of_cols)
407_Trapping_Rain_Water_II/407.Trapping_Rain_Water_II.py:14
↓ 1 callersMethod_reverse
(self, head: 'ListNode')
25. Reverse Nodes in k-Group/Solution.py:54
↓ 1 callersMethodaddSol
(int[][] board, int n, List<List<String>> ans)
-51-N_Queens/Code.java:31
↓ 1 callersMethodaddSol
(self, board, n, ans)
-51-N_Queens/Code.py:29
↓ 1 callersFunctionbacktrack
(start, subset)
80-remove-duplicates-from-sorted-array-ii/remove-duplicates-from-sorted-array-ii.py:4
↓ 1 callersMethodbacktrack
(String digits, int idx, StringBuilder combination, List<String> result)
17-letter-combination-of-a-phone-number/Solution.java:17
↓ 1 callersMethodbacktrack
(List<List<Integer>> result, List<Integer> temp, int[] candidates, int remain, int start)
39-combination-sum/combination-sum.java:12
↓ 1 callersMethodbe
(self,a, n, m)
1621-number-of-subsequences-that-satisfy-the-given-sum-condition/number-of-subsequences-that-satisfy-the-given-sum-condition.py:2
↓ 1 callersMethodcheck
(self, root, is_root, result)
-1110-Delete Nodes and Return Forest/Delete Nodes and Return Forest.py:11
↓ 1 callersMethodcoinChange
322_Coin_Change/322_Coin_Change.cpp:6
↓ 1 callersMethodconstruct
(self, grid)
427-Construct-Quad-Tree/427_Construct_quad_tree.py:13
↓ 1 callersMethodcontainsDuplicate
322_Coin_Change/217-contains-duplicate/contains-duplicate.cpp:13
↓ 1 callersMethodconvert
6.Zigzag-Conversion/zigzag-conversion.cpp:6
↓ 1 callersMethodcountGoodNumbers
(self, n: int)
1922-Count-Good-Numbers/1922_count_good_numbers.py:4
↓ 1 callersFunctiondec_str
2719-count-of-integers/2719-count-of-integers.cpp:44
↓ 1 callersFunctiondemonstrate_step_by_step
Demonstrate the algorithm step by step.
283-move-zeroes/move-zeroes.py:179
↓ 1 callersFunctiondfs
(node)
-653-Two-Sum-IV-Input-is-a-BST/Two-Sum-IV-Input-is-a-BST.py:3
↓ 1 callersFunctiondfs
(node)
-124-Binary-Tree-Maximum-Path-Sum/Binary-Tree-Maximum-Path-Sum.py:3
↓ 1 callersMethoddfs
(self,i,j,n,m,board)
130-surrounded-regions/surrounded-regions.py:2
↓ 1 callersMethoddfs
(char[][] board, String word, int i, int j, int index)
79-word-search/word-search.java:20
↓ 1 callersMethoddfs
(char[][] grid, int i, int j)
200-number-of-islands/number-of-islands.java:23
↓ 1 callersMethoddfs
(self, grid: List[List[str]], i: int, j: int)
200-number-of-islands/number-of-islands.py:22
↓ 1 callersMethoddfs
(Node node, Map<Node, Node> visited)
133-clone-graph/clone-graph.java:30
↓ 1 callersMethoddiameterOfBinaryTree
(self, root: TreeNode)
-543-Diameter-of-Binary-Tree/-543-Diameter-of-Binary-Tree.py:9
↓ 1 callersMethodf
(self, spell, potions, success)
2392-successful-pairs-of-spells-and-potions/successful-pairs-of-spells-and-potions.py:2
↓ 1 callersMethodfindMedianSortedArrays
-4-Median-Of-Two-Sorted-Arrays/-4-median_of_two_sorted_arrays.cpp:6
↓ 1 callersMethodfourSum
18-4sum/4sum.cpp:6
↓ 1 callersMethodfullJustify
(String[] words, int maxWidth)
-68-Text_Justification/Code.java:10
↓ 1 callersMethodfullJustify
-68-Text_Justification/Code.cpp:11
↓ 1 callersFunctionfull_justify
(words, max_width)
-68-Text_Justification/Code.py:4
↓ 1 callersMethodgenerate
-118-Pascal's-triangle/pascals_triangle.cpp:6
↓ 1 callersMethodgenerateParenthesis
22-generate-parentheses/generate-parentheses.cpp:6
↓ 1 callersMethodgenerateUniqueKey
Generates a unique, random 6-character key. Uses a do-while loop to ensure no key collisions occur.
535-encode-and-decode-TinyURL /EncodeAndDecodeTinyUrl.java:33
↓ 1 callersMethodgetDiv
(self,n: int)
1284-four-divisors/four-divisors.py:2
↓ 1 callersMethodino
(self,root)
98-validate-binary-search-tree/validate-binary-search-tree.py:8
↓ 1 callersMethodisAnagram
-242-Valid-Anagram/Valid_Anagram.cpp:6
↓ 1 callersMethodisNonDecreasing
(int[] nums)
3507-minimum-pair-removal-to-sort-array-i/Solution.java:13
↓ 1 callersMethodisSafe
(int[][] board, int row, int col)
-51-N_Queens/Code.java:4
↓ 1 callersMethodisSafe
(self, board, row, col)
-51-N_Queens/Code.py:2
next →1–100 of 798, ranked by callers