Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Hsinha11/Leetcode-solutions
/ functions
Functions
798 in github.com/Hsinha11/Leetcode-solutions
⨍
Functions
798
◇
Types & classes
539
↓ 1 callers
Method
isSubtree
(self, root: TreeNode, subRoot: TreeNode)
-572-subtree-of-another-tree/-572-subtree-of-another-tree.py:9
↓ 1 callers
Method
isTwo
(self, n: str)
900-reordered-power-of-2/reordered-power-of-2.py:2
↓ 1 callers
Method
maxPerformance
(self, n: int, speed: List[int], efficiency: List[int], k: int)
1383-Maximum-Performance-of-a-Team/Maximum-Performance-of-a-Team.py:5
↓ 1 callers
Method
maximumInvitations
-2127-Maximum-Employee-to-be-invited-to-a-meeting/Maximum_Employee.cpp:6
↓ 1 callers
Method
mergeMinSumPair
(int[] nums)
3507-minimum-pair-removal-to-sort-array-i/Solution.java:21
↓ 1 callers
Method
minimumHammingDistance
MinimizeHammingDistance/MinimizeHammingDistance.cpp:33
↓ 1 callers
Method
moveZeroes
Alternative two-pass approach (less optimal but easier to understand). Pass 1: Move all non-zero elements to front P
283-move-zeroes/move-zeroes.py:55
↓ 1 callers
Method
moveZeroes
'Snowball' approach - imagine zeros rolling like a snowball. Track the size of the 'snowball' (consecutive zeros). W
283-move-zeroes/move-zeroes.py:76
↓ 1 callers
Method
orangesRotting
994-Rotting-Oranges/Rotting-Oranges.cpp:13
↓ 1 callers
Method
pacificAtlantic
417-PacificAtlanticWaterFlow/417-PacificAtlanticWaterFlow.cpp:6
↓ 1 callers
Method
pacificAtlantic
(int[][] heights)
417-PacificAtlanticWaterFlow/417-PacificAtlanticWaterFlow.java:4
↓ 1 callers
Method
partition
(self, s: str)
131-Palindrome-Partitioning/palindromeparitioning.py:4
↓ 1 callers
Function
printQuadTree
(node, level=0)
427-Construct-Quad-Tree/427_Construct_quad_tree.py:36
↓ 1 callers
Method
solve
(int[][] board, int n, int col, List<String> v, List<List<String>> ans)
-51-N_Queens/Code.java:46
↓ 1 callers
Method
solve
(self, board, n, col, v, ans)
-51-N_Queens/Code.py:36
↓ 1 callers
Method
swap
(int[][] matrix)
48-rotate-image/48-rotate-image.java:2
↓ 1 callers
Function
test_solution
Comprehensive test cases for moveZeroes function.
283-move-zeroes/move-zeroes.py:95
↓ 1 callers
Function
test_solution
Test the solution with provided examples.
2965-Find_Missing_And_Repeated_Value/find-missing-and-repeated-values.py:49
↓ 1 callers
Function
test_solution
Test cases for the removeDuplicates function.
26-remove-duplicates-from-sorted-array/remove-duplicates-from-sorted-array.py:84
↓ 1 callers
Function
test_solution
Test the solution with provided examples.
1903-largest-odd-number-in-string/largest-odd-number-in-string.py:53
↓ 1 callers
Method
topKFrequent
(self, nums: List[int], k: int)
3610-find-x-sum-of-all-k-long-subarrays-i/find-x-sum-of-all-k-long-subarrays-i.py:2
↓ 1 callers
Function
trap
(height)
-42-Trapping-Rainwater/Tapping_Rainwater.py:1
↓ 1 callers
Method
unite
MinimizeHammingDistance/MinimizeHammingDistance.cpp:19
↓ 1 callers
Method
unite
1202-smallest-string-with-swaps/1202-smallest-string-with-swaps.cpp:22
Method
BookMyShow
2286-booking-concert-tickets-in-groups/2286-booking-concert-tickets-in-groups.cpp:21
Method
Codec
Initializes the object of the system.
535-encode-and-decode-TinyURL /EncodeAndDecodeTinyUrl.java:23
Method
DSU
MinimizeHammingDistance/MinimizeHammingDistance.cpp:10
Method
DSU
1202-smallest-string-with-swaps/1202-smallest-string-with-swaps.cpp:14
Method
DigitDP
2719-count-of-integers/2719-count-of-integers.cpp:20
Method
ListNode
369-plus-one-linked-list/369-plus-one-linked-list.cpp:11
Method
MyCircularDeque
Constructor to initialize the deque with size k
641-design-circular-deque/design-circular-deque.cpp:12
Method
Node
()
133-clone-graph/clone-graph.java:8
Method
Solution
237-delete-node-in-a-linked-list/delete-node-in-a-linked-list.cpp:16
Method
TreeNode
951-flip-equivalent-binary-trees/951-flip-equivalent-binary-trees.cpp:12
Method
__init__
(self, val, isLeaf, topLeft=None, topRight=None, bottomLeft=None, bottomRight=None)
427-Construct-Quad-Tree/427_Construct_quad_tree.py:3
Method
__init__
(self, nums: List[int])
303-Range_Sum_Query/Range_Sum_Query.py:4
Method
__init__
(self, val=0, left=None, right=None)
-1110-Delete Nodes and Return Forest/Delete Nodes and Return Forest.py:2
Method
__init__
(self)
-1110-Delete Nodes and Return Forest/Delete Nodes and Return Forest.py:8
Method
__init__
(self, nums: List[int])
303-range-sum-query-immutable/range-sum-query-immutable.py:3
Method
__init__
(self, val=0, left=None, right=None)
-572-subtree-of-another-tree/-572-subtree-of-another-tree.py:3
Method
__init__
(self, foods: List[str], cuisines: List[str], ratings: List[int])
2429-design-a-food-rating-system/design-a-food-rating-system.py:3
Method
__init__
(self, balance: List[int])
2169-simple-bank-system/simple-bank-system.py:3
Method
__init__
(self, val=0, left=None, right=None)
-543-Diameter-of-Binary-Tree/-543-Diameter-of-Binary-Tree.py:3
Method
__init__
(self)
381-insert-delete-getrandom-o1-duplicates-allowed/insert-delete-getrandom-o1-duplicates-allowed.py:5
Method
__init__
(self)
838-design-linked-list/design-linked-list.py:3
Method
__init__
(self, val: int = 0, left: Optional['TreeNode'] = None, right: Optional['TreeNode'] = None)
1021-distribute-coins-in-binary-tree/distribute-coins-in-binary-tree.py:6
Method
__init__
(self, height, row, col)
407_Trapping_Rain_Water_II/407.Trapping_Rain_Water_II.py:4
Method
__init__
(self)
295-find-median-from-data-stream/find-median-from-data-stream.py:3
Method
__lt__
(self, other)
407_Trapping_Rain_Water_II/407.Trapping_Rain_Water_II.py:10
Method
addAtHead
(self, val: int)
838-design-linked-list/design-linked-list.py:13
Method
addAtIndex
(self, index: int, val: int)
838-design-linked-list/design-linked-list.py:20
Method
addAtTail
(self, val: int)
838-design-linked-list/design-linked-list.py:16
Method
addNum
(self, num: int)
295-find-median-from-data-stream/find-median-from-data-stream.py:7
Method
addOperators
(self, num: str, target: int)
282-expression-and-operators/expression_and_operators.py:4
Method
addSol
-51-N_Queens/Code.cpp:19
Method
addSpaces
-68-Text_Justification/Code.cpp:6
Method
addTwoNumbers
:type l1: Optional[ListNode] :type l2: Optional[ListNode] :rtype: Optional[ListNode]
-2-Add_Two_Number/-2-Add_Two_Numbers.py:8
Method
appendCharacters
(self, s: str, t: str)
2572-append-characters-to-string-to-make-subsequence/append-characters-to-string-to-make-subsequence.py:2
Method
applyOperations
(self, nums: List[int])
2551-apply-operations-to-an-array/apply-operations-to-an-array.py:2
Method
arrayChange
(self, nums: List[int], op: List[List[int]])
2388-replace-elements-in-an-array/replace-elements-in-an-array.py:2
Method
assignEdgeWeights
(self, edges: List[List[int]])
3844-number-of-ways-to-assign-edge-weights-i/number-of-ways-to-assign-edge-weights-i.py:2
Method
asteroidCollision
(self, asteroids: List[int])
735-asteroid-collision/asteroid-collision.py:2
Method
asteroidsDestroyed
(self, mass: int, ast: List[int])
2245-destroying-asteroids/destroying-asteroids.py:2
Method
asteroidsDestroyed
2245-destroying-asteroids/destroying-asteroids.cpp:3
Method
atMostKDistinct
Helper function: count subarrays with at most K distinct integers
992-Subarrays-with-K-Different-Integers/Subarrays-with-K-Different-Integers.cpp:14
Method
averageOfLevels
(self, root: Optional[TreeNode])
637-average-of-levels-in-binary-tree/average-of-levels-in-binary-tree.py:8
Method
backtrack
(start)
131-Palindrome-Partitioning/palindromeparitioning.py:8
Method
backtrack
22-generate-parentheses/generate-parentheses.cpp:14
Method
backtrack
(ind,prev,value,exp)
282-expression-and-operators/expression_and_operators.py:7
Method
backtrack
2044-count-number-of-maximum-bitwise-OR-subsets/count_number_of_maximum_bitwise_OR_subsets.cpp:4
Method
backtrack
(temp: List[int], remain: int, start: int)
39-combination-sum/combination-sum.py:9
Method
bfs
Return longest arm of x.
-2127-Maximum-Employee-to-be-invited-to-a-meeting/Maximum_Employee.py:7
Method
build
(min_val: int, max_val: int)
449-serialize-and-deserialize-bst/serialize-and-deserialize-bst.py:37
Method
can
(target: int)
2528-Maximize-the-Minimum-Powered-City/2528-Maximize-the-Minimum-Powered-City.py:19
Function
canAttendMeetings
(intervals)
252-meeting-rooms/meeting-rooms.js:7
Method
canAttendMeetings
(int[][] intervals)
252-meeting-rooms/meeting-rooms.java:6
Method
canAttendMeetings
(self, intervals: List[List[int]])
252-meeting-rooms/meeting-rooms.py:6
Method
canBeEqual
(self, target: List[int], arr: List[int])
1556-make-two-arrays-equal-by-reversing-subarrays/make-two-arrays-equal-by-reversing-subarrays.py:2
Method
canBeTypedWords
(self, text: str, lett: str)
1264-maximum-number-of-words-you-can-type/maximum-number-of-words-you-can-type.py:2
Method
canConstruct
(self, s: str, k: int)
1502-construct-k-palindrome-strings/construct-k-palindrome-strings.py:2
Method
canConstruct
(self, ransomNote: str, magazine: str)
383-Ransom-Note/Ransom-Note.py:2
Function
canFinish
(numCourses, prerequisites)
207-course-schedule/course-schedule.js:8
Method
canFinish
(self, numCourses: int, prerequisites: List[List[int]])
207-course-schedule/course-schedule.py:7
Method
canFinish
(int numCourses, int[][] prerequisites)
207-course-schedule/course-schedule.java:6
Function
canJump
(nums)
55-jump-game/jump-game.js:7
Method
canJump
(int[] nums)
55-jump-game/jump-game.java:4
Method
canJump
(self, nums: List[int])
55-jump-game/jump-game.py:6
Method
candy
(self, ratings: List[int])
135-candy/candy.py:2
Method
changeRating
(self, food: str, newRating: int)
2429-design-a-food-rating-system/design-a-food-rating-system.py:24
Method
characterReplacement
(self, s: str, k: int)
424-longest-repeating-character-replacement/longest-repeating-character-replacement.py:2
Method
check
1752. Check if Array is Sorted and Rotated/1752. sortedarray.cpp:4
Method
checkAdjacentIncreasingSubarrays
3349-adjacent-increasing-subarrays-detection-i/3349-adjacent-increasing-subarrays-detection-i.cpp:11
Method
checkIfExist
1468-check-if-n-and-its-double-exist/check-if-n-and-its-double-exist.cpp:8
Method
checkIfExist
(self, arr: List[int])
1468-check-if-n-and-its-double-exist/check-if-n-and-its-double-exist.py:18
Method
checkValidString
(self, s: str)
678-valid-parenthesis-string/valid-parenthesis-string.py:2
Method
checkValidString
678-valid-parenthesis-string/valid-parenthesis-string.cpp:3
Function
climbStairs
(n)
70-climbing-stairs/climbing-stairs.js:7
Method
climbStairs
(int n)
70-climbing-stairs/climbing-stairs.java:4
Method
climbStairs
(self, n: int)
70-climbing-stairs/climbing-stairs.py:4
Function
cloneGraph
(node)
133-clone-graph/clone-graph.js:15
← previous
next →
101–200 of 798, ranked by callers