Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/Amanhacker/Aman-Barnwal-Leetcode-Solutions
/ functions
Functions
931 in github.com/Amanhacker/Aman-Barnwal-Leetcode-Solutions
⨍
Functions
931
◇
Types & classes
605
Method
countLetters
1180-count-substrings-with-only-one-distinct-letter/1180-count-substrings-with-only-one-distinct-letter.cpp:4
Method
countNodes
2265-count-nodes-equal-to-average-of-subtree/2265-count-nodes-equal-to-average-of-subtree.cpp:15
Method
countNodes
2049-count-nodes-with-the-highest-score/2049-count-nodes-with-the-highest-score.cpp:13
Method
countNodes
222-count-complete-tree-nodes/222-count-complete-tree-nodes.cpp:27
Method
countOdds
1523-count-odd-numbers-in-an-interval-range/1523-count-odd-numbers-in-an-interval-range.cpp:4
Method
countOnes
338-counting-bits/338-counting-bits.cpp:4
Method
countOperations
2169-count-operations-to-obtain-zero/2169-count-operations-to-obtain-zero.cpp:4
Method
countPairs
2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph/2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph.cpp:19
Method
countPairs
1530-number-of-good-leaf-nodes-pairs/1530-number-of-good-leaf-nodes-pairs.cpp:43
Method
countPaths
number-of-ways-to-arrive-at-destination/number-of-ways-to-arrive-at-destination.cpp:5
Method
countPaths
1976-number-of-ways-to-arrive-at-destination/1976-number-of-ways-to-arrive-at-destination.cpp:6
Method
countPaths
2328-number-of-increasing-paths-in-a-grid/2328-number-of-increasing-paths-in-a-grid.cpp:40
Method
countPoints
queries-on-number-of-points-inside-a-circle/queries-on-number-of-points-inside-a-circle.cpp:4
Method
countPoints
2103-rings-and-rods/2103-rings-and-rods.cpp:4
Method
countPrimeSetBits
762-prime-number-of-set-bits-in-binary-representation/762-prime-number-of-set-bits-in-binary-representation.cpp:27
Method
countRestrictedPaths
number-of-restricted-paths-from-first-to-last-node/number-of-restricted-paths-from-first-to-last-node.cpp:36
Method
countSegments
434-number-of-segments-in-a-string/434-number-of-segments-in-a-string.cpp:4
Method
countSetBits
762-prime-number-of-set-bits-in-binary-representation/762-prime-number-of-set-bits-in-binary-representation.cpp:4
Method
countSquares
count-square-submatrices-with-all-ones/count-square-submatrices-with-all-ones.cpp:4
Method
countSubIslands
count-sub-islands/count-sub-islands.cpp:48
Method
countSubstrings
647-palindromic-substrings/647-palindromic-substrings.cpp:21
Method
countTriples
1925-count-square-sum-triples/1925-count-square-sum-triples.cpp:4
Method
countValidWords
2047-number-of-valid-words-in-a-sentence/2047-number-of-valid-words-in-a-sentence.cpp:40
Method
countVowelSubstrings
2062-count-vowel-substrings-of-a-string/2062-count-vowel-substrings-of-a-string.cpp:4
Method
countWords
2085-count-common-words-with-one-occurrence/2085-count-common-words-with-one-occurrence.cpp:4
Method
createBinaryTree
2196-create-binary-tree-from-descriptions/2196-create-binary-tree-from-descriptions.cpp:15
Method
customSortString
791-custom-sort-string/791-custom-sort-string.cpp:4
Method
dayOfYear
1154-day-of-the-year/1154-day-of-the-year.cpp:13
Method
daysBetweenDates
1360-number-of-days-between-two-dates/1360-number-of-days-between-two-dates.cpp:37
Method
decode
Decodes a shortened URL to its original URL.
535-encode-and-decode-tinyurl/535-encode-and-decode-tinyurl.cpp:20
Method
decode
1720-decode-xored-array/1720-decode-xored-array.cpp:4
Method
decompressRLElist
1313-decompress-run-length-encoded-list/1313-decompress-run-length-encoded-list.cpp:4
Method
deepestLeavesSum
1302-deepest-leaves-sum/1302-deepest-leaves-sum.cpp:46
Method
deleteDuplicates
83-remove-duplicates-from-sorted-list/83-remove-duplicates-from-sorted-list.cpp:14
Method
deleteDuplicates
0082-remove-duplicates-from-sorted-list-ii/0082-remove-duplicates-from-sorted-list-ii.cpp:16
Method
deleteDuplicates
82-remove-duplicates-from-sorted-list-ii/82-remove-duplicates-from-sorted-list-ii.cpp:14
Method
deleteMiddle
2095-delete-the-middle-node-of-a-linked-list/2095-delete-the-middle-node-of-a-linked-list.cpp:14
Method
deleteNode
0450-delete-node-in-a-bst/0450-delete-node-in-a-bst.cpp:15
Method
deleteNode
237-delete-node-in-a-linked-list/237-delete-node-in-a-linked-list.cpp:12
Method
deleteNodes
1325-delete-leaves-with-a-given-value/1325-delete-leaves-with-a-given-value.cpp:15
Method
depthSum
339-nested-list-weight-sum/339-nested-list-weight-sum.cpp:46
Method
deserialize
Decodes your encoded data to tree.
297-serialize-and-deserialize-binary-tree/297-serialize-and-deserialize-binary-tree.cpp:41
Method
deserialize
Decodes your encoded data to tree.
0449-serialize-and-deserialize-bst/0449-serialize-and-deserialize-bst.cpp:52
Method
detectCapitalUse
520-detect-capital/520-detect-capital.cpp:4
Method
detectCycle
142-linked-list-cycle-ii/142-linked-list-cycle-ii.cpp:12
Method
dfs
1490-clone-n-ary-tree/1490-clone-n-ary-tree.cpp:24
Method
dfs
785-is-graph-bipartite/785-is-graph-bipartite.cpp:4
Method
dfs
1026-maximum-difference-between-node-and-ancestor/1026-maximum-difference-between-node-and-ancestor.cpp:37
Method
dfs
0990-satisfiability-of-equality-equations/0990-satisfiability-of-equality-equations.cpp:4
Method
dfs
0386-lexicographical-numbers/0386-lexicographical-numbers.cpp:4
Method
dfs
Returns true if contains a cycle
210-course-schedule-ii/210-course-schedule-ii.cpp:39
Method
dfs
find-if-path-exists-in-graph/find-if-path-exists-in-graph.cpp:4
Method
dfs
1245-tree-diameter/1245-tree-diameter.cpp:9
Method
dfs
700-search-in-a-binary-search-tree/700-search-in-a-binary-search-tree.cpp:17
Method
dfs
563-binary-tree-tilt/563-binary-tree-tilt.cpp:27
Method
dfs
reorder-routes-to-make-all-paths-lead-to-the-city-zero/reorder-routes-to-make-all-paths-lead-to-the-city-zero.cpp:6
Method
dfs
841-keys-and-rooms/841-keys-and-rooms.cpp:4
Method
dfs
0863-all-nodes-distance-k-in-binary-tree/0863-all-nodes-distance-k-in-binary-tree.cpp:49
Method
dfs
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
Method
dfs
Return true if cycle
207-course-schedule/207-course-schedule.cpp:5
Method
dfs
547-number-of-provinces/547-number-of-provinces.cpp:4
Method
dfs
2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph/2192-all-ancestors-of-a-node-in-a-directed-acyclic-graph.cpp:4
Method
dfs
all-paths-from-source-to-target/all-paths-from-source-to-target.cpp:4
Method
dfs
993-cousins-in-binary-tree/993-cousins-in-binary-tree.cpp:15
Method
dfs
797-all-paths-from-source-to-target/797-all-paths-from-source-to-target.cpp:4
Method
dfs
2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph/2316-count-unreachable-pairs-of-nodes-in-an-undirected-graph.cpp:4
Method
dfs
course-schedule-iv/course-schedule-iv.cpp:6
Method
dfs
538-convert-bst-to-greater-tree/538-convert-bst-to-greater-tree.cpp:28
Method
dfs
number-of-operations-to-make-network-connected/number-of-operations-to-make-network-connected.cpp:4
Method
dfs
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
Method
dfs
most-stones-removed-with-same-row-or-column/most-stones-removed-with-same-row-or-column.cpp:5
Method
dfs
1315-sum-of-nodes-with-even-valued-grandparent/1315-sum-of-nodes-with-even-valued-grandparent.cpp:15
Method
dfs
437-path-sum-iii/437-path-sum-iii.cpp:15
Method
dfs
694-number-of-distinct-islands/694-number-of-distinct-islands.cpp:18
Method
dfs
1448-count-good-nodes-in-binary-tree/1448-count-good-nodes-in-binary-tree.cpp:15
Method
dfs
Returns true if cycle exists, else false
684-redundant-connection/684-redundant-connection.cpp:5
Method
dfs
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
Method
dfs
2101-detonate-the-maximum-bombs/2101-detonate-the-maximum-bombs.cpp:4
Method
dfs
1022-sum-of-root-to-leaf-binary-numbers/1022-sum-of-root-to-leaf-binary-numbers.cpp:30
Method
dfs
Height of a node root of a n-ary tree
1522-diameter-of-n-ary-tree/1522-diameter-of-n-ary-tree.cpp:25
Method
dfs
329-longest-increasing-path-in-a-matrix/329-longest-increasing-path-in-a-matrix.cpp:15
Method
dfs
cheapest-flights-within-k-stops/cheapest-flights-within-k-stops.cpp:6
Method
dfs
1971-find-if-path-exists-in-graph/1971-find-if-path-exists-in-graph.cpp:4
Method
dfs
802-find-eventual-safe-states/802-find-eventual-safe-states.cpp:9
Method
dfs
339-nested-list-weight-sum/339-nested-list-weight-sum.cpp:33
Method
dfs
572-subtree-of-another-tree/572-subtree-of-another-tree.cpp:24
Method
dfs
1462-course-schedule-iv/1462-course-schedule-iv.cpp:4
Method
dfs
0419-battleships-in-a-board/0419-battleships-in-a-board.cpp:11
Method
dfs
0968-binary-tree-cameras/0968-binary-tree-cameras.cpp:15
Method
dfs
0508-most-frequent-subtree-sum/0508-most-frequent-subtree-sum.cpp:27
Method
dfs
404-sum-of-left-leaves/404-sum-of-left-leaves.cpp:15
Method
dfs
1469-find-all-the-lonely-nodes/1469-find-all-the-lonely-nodes.cpp:15
Method
dfs
1559-detect-cycles-in-2d-grid/1559-detect-cycles-in-2d-grid.cpp:10
Method
dfs
Return sum for current node root
1973-count-nodes-equal-to-sum-of-descendants/1973-count-nodes-equal-to-sum-of-descendants.cpp:16
Method
dfs
222-count-complete-tree-nodes/222-count-complete-tree-nodes.cpp:15
Method
dfs
2385-amount-of-time-for-binary-tree-to-be-infected/2385-amount-of-time-for-binary-tree-to-be-infected.cpp:34
Method
dfs
find-all-groups-of-farmland/find-all-groups-of-farmland.cpp:12
Method
dfs
0 means unvisited, 1 - processed, 2 - processing
course-schedule/course-schedule.cpp:7
Method
dfs
number-of-restricted-paths-from-first-to-last-node/number-of-restricted-paths-from-first-to-last-node.cpp:6
Method
dfs
417-pacific-atlantic-water-flow/417-pacific-atlantic-water-flow.cpp:16
← previous
next →
201–300 of 931, ranked by callers