MCPcopy Create free account

hub / github.com/Amanhacker/Aman-Barnwal-Leetcode-Solutions / functions

Functions931 in github.com/Amanhacker/Aman-Barnwal-Leetcode-Solutions

MethodbackspaceCompare
844-backspace-string-compare/844-backspace-string-compare.cpp:4
MethodbadSensor
1826-faulty-sensor/1826-faulty-sensor.cpp:4
MethodbalanceBST
balance-a-binary-search-tree/balance-a-binary-search-tree.cpp:41
Methodbfs
0865-smallest-subtree-with-all-the-deepest-nodes/0865-smallest-subtree-with-all-the-deepest-nodes.cpp:15
Methodbfs
210-course-schedule-ii/210-course-schedule-ii.cpp:4
Methodbfs
742-closest-leaf-in-a-binary-tree/742-closest-leaf-in-a-binary-tree.cpp:62
Methodbfs
1602-find-nearest-right-node-in-binary-tree/1602-find-nearest-right-node-in-binary-tree.cpp:15
Methodbfs
513-find-bottom-left-tree-value/513-find-bottom-left-tree-value.cpp:15
Methodbfs
2415-reverse-odd-levels-of-binary-tree/2415-reverse-odd-levels-of-binary-tree.cpp:15
Methodbfs
1609-even-odd-tree/1609-even-odd-tree.cpp:15
Methodbfs
Form the graph
0863-all-nodes-distance-k-in-binary-tree/0863-all-nodes-distance-k-in-binary-tree.cpp:14
Methodbfs
0429-n-ary-tree-level-order-traversal/0429-n-ary-tree-level-order-traversal.cpp:24
Methodbfs
2359-find-closest-node-to-given-two-nodes/2359-find-closest-node-to-given-two-nodes.cpp:4
Methodbfs
310-minimum-height-trees/310-minimum-height-trees.cpp:4
Methodbfs
minimum-cost-to-make-at-least-one-valid-path-in-a-grid/minimum-cost-to-make-at-least-one-valid-path-in-a-grid.cpp:17
Methodbfs
0117-populating-next-right-pointers-in-each-node-ii/0117-populating-next-right-pointers-in-each-node-ii.cpp:22
Methodbfs
515-find-largest-value-in-each-tree-row/515-find-largest-value-in-each-tree-row.cpp:15
Methodbfs
695-max-area-of-island/695-max-area-of-island.cpp:16
Methodbfs
1123-lowest-common-ancestor-of-deepest-leaves/1123-lowest-common-ancestor-of-deepest-leaves.cpp:15
Methodbfs
1376-time-needed-to-inform-all-employees/1376-time-needed-to-inform-all-employees.cpp:6
Methodbfs
max-area-of-island/max-area-of-island.cpp:16
Methodbfs
0116-populating-next-right-pointers-in-each-node/0116-populating-next-right-pointers-in-each-node.cpp:22
Methodbfs
314-binary-tree-vertical-order-traversal/314-binary-tree-vertical-order-traversal.cpp:19
Methodbfs
1302-deepest-leaves-sum/1302-deepest-leaves-sum.cpp:15
Methodbfs
1466-reorder-routes-to-make-all-paths-lead-to-the-city-zero/1466-reorder-routes-to-make-all-paths-lead-to-the-city-zero.cpp:6
Methodbfs
number-of-islands/number-of-islands.cpp:16
Methodbfs
0449-serialize-and-deserialize-bst/0449-serialize-and-deserialize-bst.cpp:13
Methodbfs
733-flood-fill/733-flood-fill.cpp:15
Methodbfs
1161-maximum-level-sum-of-a-binary-tree/1161-maximum-level-sum-of-a-binary-tree.cpp:15
MethodbinarySearch
69-sqrtx/69-sqrtx.cpp:4
MethodbinaryTreePaths
257-binary-tree-paths/257-binary-tree-paths.cpp:37
MethodbitwiseComplement
1009-complement-of-base-10-integer/1009-complement-of-base-10-integer.cpp:4
MethodbuildArray
1920-build-array-from-permutation/1920-build-array-from-permutation.cpp:4
MethodbuildTree
Build the expression tree
1628-design-an-expression-tree-with-evaluate-function/1628-design-an-expression-tree-with-evaluate-function.cpp:76
MethodbuildTree
105-construct-binary-tree-from-preorder-and-inorder-traversal/105-construct-binary-tree-from-preorder-and-inorder-traversal.cpp:57
MethodbuildTreeHelper
105-construct-binary-tree-from-preorder-and-inorder-traversal/105-construct-binary-tree-from-preorder-and-inorder-traversal.cpp:15
MethodcalcEquation
399-evaluate-division/399-evaluate-division.cpp:4
MethodcalcEquation
evaluate-division/evaluate-division.cpp:4
Methodcalculate
227-basic-calculator-ii/227-basic-calculator-ii.cpp:4
MethodcalculateTime
1165-single-row-keyboard/1165-single-row-keyboard.cpp:4
MethodcanAttendMeetings
252-meeting-rooms/252-meeting-rooms.cpp:9
MethodcanBeTypedWords
1935-maximum-number-of-words-you-can-type/1935-maximum-number-of-words-you-can-type.cpp:4
MethodcanConstruct
383-ransom-note/383-ransom-note.cpp:4
MethodcanFinish
207-course-schedule/207-course-schedule.cpp:22
MethodcanFinish
course-schedule/course-schedule.cpp:31
MethodcanPermutePalindrome
266-palindrome-permutation/266-palindrome-permutation.cpp:4
MethodcanPlaceFlowers
605-can-place-flowers/605-can-place-flowers.cpp:4
MethodcanVisitAllRooms
841-keys-and-rooms/841-keys-and-rooms.cpp:17
MethodcapitalizeTitle
2129-capitalize-the-title/2129-capitalize-the-title.cpp:4
MethodcarPooling
1094-car-pooling/1094-car-pooling.cpp:4
Methodcheck
719-find-k-th-smallest-pair-distance/719-find-k-th-smallest-pair-distance.cpp:4
MethodcheckAlmostEquivalent
2068-check-whether-two-strings-are-almost-equivalent/2068-check-whether-two-strings-are-almost-equivalent.cpp:4
MethodcheckArithmeticSubarrays
1630-arithmetic-subarrays/1630-arithmetic-subarrays.cpp:4
MethodcheckIfPrerequisite
course-schedule-iv/course-schedule-iv.cpp:26
MethodcheckIfPrerequisite
1462-course-schedule-iv/1462-course-schedule-iv.cpp:20
MethodcheckIn
1396-design-underground-system/1396-design-underground-system.cpp:13
MethodcheckOnesSegment
1784-check-if-binary-string-has-at-most-one-segment-of-ones/1784-check-if-binary-string-has-at-most-one-segment-of-ones.cpp:4
MethodcheckOut
1396-design-underground-system/1396-design-underground-system.cpp:19
MethodcheckPerfectNumber
507-perfect-number/507-perfect-number.cpp:4
MethodcheckRecord
551-student-attendance-record-i/551-student-attendance-record-i.cpp:4
MethodcheckString
2124-check-if-all-as-appears-before-all-bs/2124-check-if-all-as-appears-before-all-bs.cpp:4
MethodcheckSubarraySum
523-continuous-subarray-sum/523-continuous-subarray-sum.cpp:4
MethodcheckValid
2133-check-if-every-row-and-column-contains-all-numbers/2133-check-if-every-row-and-column-contains-all-numbers.cpp:4
MethodcheckValidString
678-valid-parenthesis-string/678-valid-parenthesis-string.cpp:4
MethodclimbStairs
0070-climbing-stairs/0070-climbing-stairs.cpp:4
MethodcloneGraph
133-clone-graph/133-clone-graph.cpp:27
MethodcloneTree
1490-clone-n-ary-tree/1490-clone-n-ary-tree.cpp:45
MethodclosedIsland
number-of-closed-islands/number-of-closed-islands.cpp:32
MethodclosestMeetingNode
2359-find-closest-node-to-given-two-nodes/2359-find-closest-node-to-given-two-nodes.cpp:36
MethodclosestValue
270-closest-binary-search-tree-value/270-closest-binary-search-tree-value.cpp:33
Methodcmp
2404-most-frequent-even-element/2404-most-frequent-even-element.cpp:4
Methodcmp
1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance/1334-find-the-city-with-the-smallest-number-of-neighbors-at-a-threshold-distance.cpp:4
Methodcmp
937-reorder-data-in-log-files/937-reorder-data-in-log-files.cpp:4
Methodcmp
maximum-length-of-pair-chain/maximum-length-of-pair-chain.cpp:4
Methodcmp
252-meeting-rooms/252-meeting-rooms.cpp:4
Methodcmp
501-find-mode-in-binary-search-tree/501-find-mode-in-binary-search-tree.cpp:15
MethodconfusingNumber
1056-confusing-number/1056-confusing-number.cpp:4
Methodconnect
0117-populating-next-right-pointers-in-each-node-ii/0117-populating-next-right-pointers-in-each-node-ii.cpp:61
Methodconnect
0116-populating-next-right-pointers-in-each-node/0116-populating-next-right-pointers-in-each-node.cpp:61
Methodconstruct2DArray
2022-convert-1d-array-into-2d-array/2022-convert-1d-array-into-2d-array.cpp:4
MethodconstructBST
Recursively construct the balanced BST
balance-a-binary-search-tree/balance-a-binary-search-tree.cpp:27
MethodconstructFromPrePost
889-construct-binary-tree-from-preorder-and-postorder-traversal/889-construct-binary-tree-from-preorder-and-postorder-traversal.cpp:31
MethodconstructHelper
889-construct-binary-tree-from-preorder-and-postorder-traversal/889-construct-binary-tree-from-preorder-and-postorder-traversal.cpp:15
MethodcontainsCycle
1559-detect-cycles-in-2d-grid/1559-detect-cycles-in-2d-grid.cpp:38
MethodcontainsDuplicate
217-contains-duplicate/217-contains-duplicate.cpp:4
MethodcontainsPattern
1566-detect-pattern-of-length-m-repeated-k-or-more-times/1566-detect-pattern-of-length-m-repeated-k-or-more-times.cpp:4
MethodconvertBST
538-convert-bst-to-greater-tree/538-convert-bst-to-greater-tree.cpp:40
MethodconvertToTitle
168-excel-sheet-column-title/168-excel-sheet-column-title.cpp:4
MethodcopyRandomBinaryTree
1485-clone-binary-tree-with-random-pointer/1485-clone-binary-tree-with-random-pointer.cpp:35
MethodcopyRandomList
138-copy-list-with-random-pointer/138-copy-list-with-random-pointer.cpp:20
MethodcorrectBinaryTree
1660-correct-a-binary-tree/1660-correct-a-binary-tree.cpp:17
MethodcountBattleships
0419-battleships-in-a-board/0419-battleships-in-a-board.cpp:28
MethodcountBits
338-counting-bits/338-counting-bits.cpp:16
MethodcountBits
0338-counting-bits/0338-counting-bits.cpp:4
MethodcountElements
2148-count-elements-with-strictly-smaller-and-greater-elements/2148-count-elements-with-strictly-smaller-and-greater-elements.cpp:4
MethodcountElements
1426-counting-elements/1426-counting-elements.cpp:4
MethodcountGoodRectangles
1725-number-of-rectangles-that-can-form-the-largest-square/1725-number-of-rectangles-that-can-form-the-largest-square.cpp:4
MethodcountHighestScoreNodes
2049-count-nodes-with-the-highest-score/2049-count-nodes-with-the-highest-score.cpp:23
MethodcountKDifference
2006-count-number-of-pairs-with-absolute-difference-k/2006-count-number-of-pairs-with-absolute-difference-k.cpp:4
MethodcountLargestGroup
1399-count-largest-group/1399-count-largest-group.cpp:16
← previousnext →101–200 of 931, ranked by callers