MCPcopy Create free account

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

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

MethodcountLetters
1180-count-substrings-with-only-one-distinct-letter/1180-count-substrings-with-only-one-distinct-letter.cpp:4
MethodcountNodes
2265-count-nodes-equal-to-average-of-subtree/2265-count-nodes-equal-to-average-of-subtree.cpp:15
MethodcountNodes
2049-count-nodes-with-the-highest-score/2049-count-nodes-with-the-highest-score.cpp:13
MethodcountNodes
222-count-complete-tree-nodes/222-count-complete-tree-nodes.cpp:27
MethodcountOdds
1523-count-odd-numbers-in-an-interval-range/1523-count-odd-numbers-in-an-interval-range.cpp:4
MethodcountOnes
338-counting-bits/338-counting-bits.cpp:4
MethodcountOperations
2169-count-operations-to-obtain-zero/2169-count-operations-to-obtain-zero.cpp:4
MethodcountPairs
2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph/2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph.cpp:19
MethodcountPairs
1530-number-of-good-leaf-nodes-pairs/1530-number-of-good-leaf-nodes-pairs.cpp:43
MethodcountPaths
number-of-ways-to-arrive-at-destination/number-of-ways-to-arrive-at-destination.cpp:5
MethodcountPaths
1976-number-of-ways-to-arrive-at-destination/1976-number-of-ways-to-arrive-at-destination.cpp:6
MethodcountPaths
2328-number-of-increasing-paths-in-a-grid/2328-number-of-increasing-paths-in-a-grid.cpp:40
MethodcountPoints
queries-on-number-of-points-inside-a-circle/queries-on-number-of-points-inside-a-circle.cpp:4
MethodcountPoints
2103-rings-and-rods/2103-rings-and-rods.cpp:4
MethodcountPrimeSetBits
762-prime-number-of-set-bits-in-binary-representation/762-prime-number-of-set-bits-in-binary-representation.cpp:27
MethodcountRestrictedPaths
number-of-restricted-paths-from-first-to-last-node/number-of-restricted-paths-from-first-to-last-node.cpp:36
MethodcountSegments
434-number-of-segments-in-a-string/434-number-of-segments-in-a-string.cpp:4
MethodcountSetBits
762-prime-number-of-set-bits-in-binary-representation/762-prime-number-of-set-bits-in-binary-representation.cpp:4
MethodcountSquares
count-square-submatrices-with-all-ones/count-square-submatrices-with-all-ones.cpp:4
MethodcountSubIslands
count-sub-islands/count-sub-islands.cpp:48
MethodcountSubstrings
647-palindromic-substrings/647-palindromic-substrings.cpp:21
MethodcountTriples
1925-count-square-sum-triples/1925-count-square-sum-triples.cpp:4
MethodcountValidWords
2047-number-of-valid-words-in-a-sentence/2047-number-of-valid-words-in-a-sentence.cpp:40
MethodcountVowelSubstrings
2062-count-vowel-substrings-of-a-string/2062-count-vowel-substrings-of-a-string.cpp:4
MethodcountWords
2085-count-common-words-with-one-occurrence/2085-count-common-words-with-one-occurrence.cpp:4
MethodcreateBinaryTree
2196-create-binary-tree-from-descriptions/2196-create-binary-tree-from-descriptions.cpp:15
MethodcustomSortString
791-custom-sort-string/791-custom-sort-string.cpp:4
MethoddayOfYear
1154-day-of-the-year/1154-day-of-the-year.cpp:13
MethoddaysBetweenDates
1360-number-of-days-between-two-dates/1360-number-of-days-between-two-dates.cpp:37
Methoddecode
Decodes a shortened URL to its original URL.
535-encode-and-decode-tinyurl/535-encode-and-decode-tinyurl.cpp:20
Methoddecode
1720-decode-xored-array/1720-decode-xored-array.cpp:4
MethoddecompressRLElist
1313-decompress-run-length-encoded-list/1313-decompress-run-length-encoded-list.cpp:4
MethoddeepestLeavesSum
1302-deepest-leaves-sum/1302-deepest-leaves-sum.cpp:46
MethoddeleteDuplicates
83-remove-duplicates-from-sorted-list/83-remove-duplicates-from-sorted-list.cpp:14
MethoddeleteDuplicates
0082-remove-duplicates-from-sorted-list-ii/0082-remove-duplicates-from-sorted-list-ii.cpp:16
MethoddeleteDuplicates
82-remove-duplicates-from-sorted-list-ii/82-remove-duplicates-from-sorted-list-ii.cpp:14
MethoddeleteMiddle
2095-delete-the-middle-node-of-a-linked-list/2095-delete-the-middle-node-of-a-linked-list.cpp:14
MethoddeleteNode
0450-delete-node-in-a-bst/0450-delete-node-in-a-bst.cpp:15
MethoddeleteNode
237-delete-node-in-a-linked-list/237-delete-node-in-a-linked-list.cpp:12
MethoddeleteNodes
1325-delete-leaves-with-a-given-value/1325-delete-leaves-with-a-given-value.cpp:15
MethoddepthSum
339-nested-list-weight-sum/339-nested-list-weight-sum.cpp:46
Methoddeserialize
Decodes your encoded data to tree.
297-serialize-and-deserialize-binary-tree/297-serialize-and-deserialize-binary-tree.cpp:41
Methoddeserialize
Decodes your encoded data to tree.
0449-serialize-and-deserialize-bst/0449-serialize-and-deserialize-bst.cpp:52
MethoddetectCapitalUse
520-detect-capital/520-detect-capital.cpp:4
MethoddetectCycle
142-linked-list-cycle-ii/142-linked-list-cycle-ii.cpp:12
Methoddfs
1490-clone-n-ary-tree/1490-clone-n-ary-tree.cpp:24
Methoddfs
785-is-graph-bipartite/785-is-graph-bipartite.cpp:4
Methoddfs
1026-maximum-difference-between-node-and-ancestor/1026-maximum-difference-between-node-and-ancestor.cpp:37
Methoddfs
0990-satisfiability-of-equality-equations/0990-satisfiability-of-equality-equations.cpp:4
Methoddfs
0386-lexicographical-numbers/0386-lexicographical-numbers.cpp:4
Methoddfs
Returns true if contains a cycle
210-course-schedule-ii/210-course-schedule-ii.cpp:39
Methoddfs
find-if-path-exists-in-graph/find-if-path-exists-in-graph.cpp:4
Methoddfs
1245-tree-diameter/1245-tree-diameter.cpp:9
Methoddfs
700-search-in-a-binary-search-tree/700-search-in-a-binary-search-tree.cpp:17
Methoddfs
563-binary-tree-tilt/563-binary-tree-tilt.cpp:27
Methoddfs
reorder-routes-to-make-all-paths-lead-to-the-city-zero/reorder-routes-to-make-all-paths-lead-to-the-city-zero.cpp:6
Methoddfs
841-keys-and-rooms/841-keys-and-rooms.cpp:4
Methoddfs
0863-all-nodes-distance-k-in-binary-tree/0863-all-nodes-distance-k-in-binary-tree.cpp:49
Methoddfs
1st arg - Time taken, 2nd arg - Whether this node has any of its children which has apples
1443-minimum-time-to-collect-all-apples-in-a-tree/1443-minimum-time-to-collect-all-apples-in-a-tree.cpp:5
Methoddfs
Return true if cycle
207-course-schedule/207-course-schedule.cpp:5
Methoddfs
547-number-of-provinces/547-number-of-provinces.cpp:4
Methoddfs
2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph/2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph.cpp:4
Methoddfs
all-paths-from-source-to-target/all-paths-from-source-to-target.cpp:4
Methoddfs
993-cousins-in-binary-tree/993-cousins-in-binary-tree.cpp:15
Methoddfs
797-all-paths-from-source-to-target/797-all-paths-from-source-to-target.cpp:4
Methoddfs
2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph/2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph.cpp:4
Methoddfs
course-schedule-iv/course-schedule-iv.cpp:6
Methoddfs
538-convert-bst-to-greater-tree/538-convert-bst-to-greater-tree.cpp:28
Methoddfs
number-of-operations-to-make-network-connected/number-of-operations-to-make-network-connected.cpp:4
Methoddfs
If node is a safe node, then return true, else if it contains a cycle path, then return false
find-eventual-safe-states/find-eventual-safe-states.cpp:7
Methoddfs
most-stones-removed-with-same-row-or-column/most-stones-removed-with-same-row-or-column.cpp:5
Methoddfs
1315-sum-of-nodes-with-even-valued-grandparent/1315-sum-of-nodes-with-even-valued-grandparent.cpp:15
Methoddfs
437-path-sum-iii/437-path-sum-iii.cpp:15
Methoddfs
694-number-of-distinct-islands/694-number-of-distinct-islands.cpp:18
Methoddfs
1448-count-good-nodes-in-binary-tree/1448-count-good-nodes-in-binary-tree.cpp:15
Methoddfs
Returns true if cycle exists, else false
684-redundant-connection/684-redundant-connection.cpp:5
Methoddfs
dfs(node) is the excess number of coins in the subtree at or below this node
0979-distribute-coins-in-binary-tree/0979-distribute-coins-in-binary-tree.cpp:16
Methoddfs
2101-detonate-the-maximum-bombs/2101-detonate-the-maximum-bombs.cpp:4
Methoddfs
1022-sum-of-root-to-leaf-binary-numbers/1022-sum-of-root-to-leaf-binary-numbers.cpp:30
Methoddfs
Height of a node root of a n-ary tree
1522-diameter-of-n-ary-tree/1522-diameter-of-n-ary-tree.cpp:25
Methoddfs
329-longest-increasing-path-in-a-matrix/329-longest-increasing-path-in-a-matrix.cpp:15
Methoddfs
cheapest-flights-within-k-stops/cheapest-flights-within-k-stops.cpp:6
Methoddfs
1971-find-if-path-exists-in-graph/1971-find-if-path-exists-in-graph.cpp:4
Methoddfs
802-find-eventual-safe-states/802-find-eventual-safe-states.cpp:9
Methoddfs
339-nested-list-weight-sum/339-nested-list-weight-sum.cpp:33
Methoddfs
572-subtree-of-another-tree/572-subtree-of-another-tree.cpp:24
Methoddfs
1462-course-schedule-iv/1462-course-schedule-iv.cpp:4
Methoddfs
0419-battleships-in-a-board/0419-battleships-in-a-board.cpp:11
Methoddfs
0968-binary-tree-cameras/0968-binary-tree-cameras.cpp:15
Methoddfs
0508-most-frequent-subtree-sum/0508-most-frequent-subtree-sum.cpp:27
Methoddfs
404-sum-of-left-leaves/404-sum-of-left-leaves.cpp:15
Methoddfs
1469-find-all-the-lonely-nodes/1469-find-all-the-lonely-nodes.cpp:15
Methoddfs
1559-detect-cycles-in-2d-grid/1559-detect-cycles-in-2d-grid.cpp:10
Methoddfs
Return sum for current node root
1973-count-nodes-equal-to-sum-of-descendants/1973-count-nodes-equal-to-sum-of-descendants.cpp:16
Methoddfs
222-count-complete-tree-nodes/222-count-complete-tree-nodes.cpp:15
Methoddfs
2385-amount-of-time-for-binary-tree-to-be-infected/2385-amount-of-time-for-binary-tree-to-be-infected.cpp:34
Methoddfs
find-all-groups-of-farmland/find-all-groups-of-farmland.cpp:12
Methoddfs
0 means unvisited, 1 - processed, 2 - processing
course-schedule/course-schedule.cpp:7
Methoddfs
number-of-restricted-paths-from-first-to-last-node/number-of-restricted-paths-from-first-to-last-node.cpp:6
Methoddfs
417-pacific-atlantic-water-flow/417-pacific-atlantic-water-flow.cpp:16
← previousnext →201–300 of 931, ranked by callers