26/05/2020 (7) Depth-first Search - LeetCode
Depth-first Search
You have solved 0 / 125 problems.
Show problem tags
# Title Tags Acceptance Diffi
200 Number of Islands (/problems… Depth-first Search (/tag/depth-first-search) 46.0% Me
Breadth-first Search (/tag/breadth-first-search)
Union Find (/tag/union-find)
Google (/company/google)
Facebook (/company/facebook)
Microsoft (/company/microsoft)
Amazon (/company/amazon)
Zenefits (/company/zenefits)
104 Maximum Depth of Binary Tre… Tree (/tag/tree) 65.1% Ea
Depth-first Search (/tag/depth-first-search)
Uber (/company/uber)
LinkedIn (/company/linkedin)
Apple (/company/apple) Yahoo (/company/yahoo)
1192 Critical Connections in a Net… Depth-first Search (/tag/depth-first-search) 48.7% Ha
Amazon (/company/amazon)
108 Convert Sorted Array to Binar… Tree (/tag/tree) 56.7% Ea
Depth-first Search (/tag/depth-first-search)
Airbnb (/company/airbnb)
301 Remove Invalid Parentheses (… Depth-first Search (/tag/depth-first-search) 42.6% Ha
Breadth-first Search (/tag/breadth-first-search)
Facebook (/company/facebook)
394 Decode String (/problems/de… Stack (/tag/stack) 49.0% Me
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
Facebook (/company/facebook)
Yelp (/company/yelp)
Coupang (/company/coupang)
100 Same Tree (/problems/same-t… Tree (/tag/tree) 52.3% Ea
Depth-first Search (/tag/depth-first-search)
Bloomberg (/company/bloomberg)
105 Construct Binary Tree from Pr… Array (/tag/array) Tree (/tag/tree) 47.3% Me
Depth-first Search (/tag/depth-first-search)
Bloomberg (/company/bloomberg)
695 Max Area of Island (/problem… Array (/tag/array) 61.7% Me
Depth-first Search (/tag/depth-first-search)
Intuit (/company/intuit)
959 Regions Cut By Slashes (/pro… Depth-first Search (/tag/depth-first-search) 65.8% Me
Union Find (/tag/union-find) Graph (/tag/graph)
Uber (/company/uber)
124 Binary Tree Maximum Path S… Tree (/tag/tree) 33.8% Ha
Depth-first Search (/tag/depth-first-search)
Microsoft (/company/microsoft)
Baidu (/company/baidu)
979 Distribute Coins in Binary Tre… Tree (/tag/tree) 68.2% Me
Depth-first Search (/tag/depth-first-search)
[Link] 1/9
26/05/2020 (7) Depth-first Search - LeetCode
# Title Google (/company/google)
Tags Acceptance Diffi
99 Recover Binary Search Tree (/… Tree (/tag/tree) 38.7% Ha
Depth-first Search (/tag/depth-first-search)
199 Binary Tree Right Side View (/… Tree (/tag/tree) 53.0% Me
Depth-first Search (/tag/depth-first-search)
Breadth-first Search (/tag/breadth-first-search)
Amazon (/company/amazon)
110 Balanced Binary Tree (/proble… Tree (/tag/tree) 43.0% Ea
Depth-first Search (/tag/depth-first-search)
Bloomberg (/company/bloomberg)
101 Symmetric Tree (/problems/s… Tree (/tag/tree) 46.3% Ea
Depth-first Search (/tag/depth-first-search)
Breadth-first Search (/tag/breadth-first-search)
Microsoft (/company/microsoft)
Bloomberg (/company/bloomberg)
LinkedIn (/company/linkedin)
114 Flatten Binary Tree to Linked … Tree (/tag/tree) 47.9% Me
Depth-first Search (/tag/depth-first-search)
Microsoft (/company/microsoft)
109 Convert Sorted List to Binary … Linked List (/tag/linked-list) 46.4% Me
Depth-first Search (/tag/depth-first-search)
Zenefits (/company/zenefits)
834 Sum of Distances in Tree (/pr… Tree (/tag/tree) 43.0% Ha
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
116 Populating Next Right Pointer… Tree (/tag/tree) 43.6% Me
Depth-first Search (/tag/depth-first-search)
Microsoft (/company/microsoft)
679 24 Game (/problems/24-game) Depth-first Search (/tag/depth-first-search) 45.9% Ha
Google (/company/google)
339 Nested List Weight Sum (/pro… Depth-first Search (/tag/depth-first-search) 72.9% Ea
LinkedIn (/company/linkedin)
133 Clone Graph (/problems/clon… Depth-first Search (/tag/depth-first-search) 33.3% Me
Breadth-first Search (/tag/breadth-first-search)
Graph (/tag/graph) Google (/company/google)
Facebook (/company/facebook)
Uber (/company/uber)
Pocket Gems (/company/pocket-gems)
547 Friend Circles (/problems/frie… Depth-first Search (/tag/depth-first-search) 57.6% Me
Union Find (/tag/union-find)
Bloomberg (/company/bloomberg)
Two Sigma (/company/two-sigma)
332 Reconstruct Itinerary (/proble… Depth-first Search (/tag/depth-first-search) 34.7% Me
Graph (/tag/graph) Google (/company/google)
257 Binary Tree Paths (/problems/… Tree (/tag/tree) 50.3% Ea
Depth-first Search (/tag/depth-first-search)
[Link] 2/9
26/05/2020 (7) Depth-first Search - LeetCode
# Title Google (/company/google)
Tags Acceptance Diffi
Facebook (/company/facebook)
Apple (/company/apple)
546 Remove Boxes (/problems/re… Dynamic Programming (/tag/dynamic-programming) 41.7% Ha
Depth-first Search (/tag/depth-first-search)
Tencent (/company/tencent)
364 Nested List Weight Sum II (/p… Depth-first Search (/tag/depth-first-search) 62.2% Me
LinkedIn (/company/linkedin)
112 Path Sum (/problems/path-su… Tree (/tag/tree) 40.5% Ea
Depth-first Search (/tag/depth-first-search)
Microsoft (/company/microsoft)
753 Cracking the Safe (/problems… Math (/tag/math) 50.0% Ha
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
337 House Robber III (/problems/… Tree (/tag/tree) 50.2% Me
Depth-first Search (/tag/depth-first-search)
Uber (/company/uber)
329 Longest Increasing Path in a … Depth-first Search (/tag/depth-first-search) 42.8% Ha
Topological Sort (/tag/topological-sort)
Memoization (/tag/memoization)
Google (/company/google)
980 Unique Paths III (/problems/u… Backtracking (/tag/backtracking) 72.9% Ha
Depth-first Search (/tag/depth-first-search)
LimeBike (/company/limebike)
207 Course Schedule (/problems/… Depth-first Search (/tag/depth-first-search) 41.7% Me
Breadth-first Search (/tag/breadth-first-search)
Graph (/tag/graph)
Topological Sort (/tag/topological-sort)
Uber (/company/uber) Apple (/company/apple)
Zenefits (/company/zenefits) Yelp (/company/yelp)
489 Robot Room Cleaner (/proble… Depth-first Search (/tag/depth-first-search) 68.8% Ha
Google (/company/google)
Facebook (/company/facebook)
111 Minimum Depth of Binary Tre… Tree (/tag/tree) 37.0% Ea
Depth-first Search (/tag/depth-first-search)
Breadth-first Search (/tag/breadth-first-search)
106 Construct Binary Tree from In… Array (/tag/array) Tree (/tag/tree) 44.5% Me
Depth-first Search (/tag/depth-first-search)
Microsoft (/company/microsoft)
417 Pacific Atlantic Water Flow (/… Depth-first Search (/tag/depth-first-search) 40.3% Me
Breadth-first Search (/tag/breadth-first-search)
Google (/company/google)
529 Minesweeper (/problems/min… Depth-first Search (/tag/depth-first-search) 58.2% Me
Breadth-first Search (/tag/breadth-first-search)
Amazon (/company/amazon)
638 Shopping Offers (/problems/s… Dynamic Programming (/tag/dynamic-programming) 50.9% Me
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
130 Surrounded Regions (/proble… Depth-first Search (/tag/depth-first-search) 26.2% Me
Breadth-first Search (/tag/breadth-first-search)
[Link] 3/9
26/05/2020 (7) Depth-first Search - LeetCode
# Title Union Find (/tag/union-find)
Tags Acceptance Diffi
947 Most Stones Removed with S… Depth-first Search (/tag/depth-first-search) 55.3% Me
Union Find (/tag/union-find)
542 01 Matrix (/problems/01-matrix) Depth-first Search (/tag/depth-first-search) 39.1% Me
Breadth-first Search (/tag/breadth-first-search)
Google (/company/google)
863 All Nodes Distance K in Binar… Tree (/tag/tree) 54.1% Me
Depth-first Search (/tag/depth-first-search)
Breadth-first Search (/tag/breadth-first-search)
Amazon (/company/amazon)
690 Employee Importance (/probl… Hash Table (/tag/hash-table) 56.4% Ea
Depth-first Search (/tag/depth-first-search)
Breadth-first Search (/tag/breadth-first-search)
Uber (/company/uber)
98 Validate Binary Search Tree (/… Tree (/tag/tree) 27.5% Me
Depth-first Search (/tag/depth-first-search)
Facebook (/company/facebook)
Microsoft (/company/microsoft)
Amazon (/company/amazon)
Bloomberg (/company/bloomberg)
113 Path Sum II (/problems/path-… Tree (/tag/tree) 45.5% Me
Depth-first Search (/tag/depth-first-search)
Bloomberg (/company/bloomberg)
430 Flatten a Multilevel Doubly Li… Linked List (/tag/linked-list) 51.4% Me
Depth-first Search (/tag/depth-first-search)
494 Target Sum (/problems/target… Dynamic Programming (/tag/dynamic-programming) 46.6% Me
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
Facebook (/company/facebook)
117 Populating Next Right Pointer… Tree (/tag/tree) 38.1% Me
Depth-first Search (/tag/depth-first-search)
Facebook (/company/facebook)
Microsoft (/company/microsoft)
Bloomberg (/company/bloomberg)
1110 Delete Nodes And Return For… Tree (/tag/tree) 66.3% Me
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
743 Network Delay Time (/proble… Heap (/tag/heap) 45.4% Me
Depth-first Search (/tag/depth-first-search)
Breadth-first Search (/tag/breadth-first-search)
Graph (/tag/graph)
Akuna Capital (/company/akuna-capital)
749 Contain Virus (/problems/con… Depth-first Search (/tag/depth-first-search) 44.1% Ha
Bloomberg (/company/bloomberg)
897 Increasing Order Search Tree … Tree (/tag/tree) 69.1% Ea
Depth-first Search (/tag/depth-first-search)
210 Course Schedule II (/problem… Depth-first Search (/tag/depth-first-search) 39.0% Me
Breadth-first Search (/tag/breadth-first-search)
[Link] 4/9
26/05/2020 (7) Depth-first Search - LeetCode
# Title Graph (/tag/graph)
Tags Acceptance Diffi
Topological Sort (/tag/topological-sort)
Facebook (/company/facebook)
Zenefits (/company/zenefits)
664 Strange Printer (/problems/str… Dynamic Programming (/tag/dynamic-programming) 39.7% Ha
Depth-first Search (/tag/depth-first-search)
NetEase (/company/netease)
872 Leaf-Similar Trees (/problems… Tree (/tag/tree) 64.9% Ea
Depth-first Search (/tag/depth-first-search)
366 Find Leaves of Binary Tree (/p… Tree (/tag/tree) 69.9% Me
Depth-first Search (/tag/depth-first-search)
LinkedIn (/company/linkedin)
513 Find Bottom Left Tree Value (/… Tree (/tag/tree) 60.8% Me
Depth-first Search (/tag/depth-first-search)
Breadth-first Search (/tag/breadth-first-search)
Microsoft (/company/microsoft)
721 Accounts Merge (/problems/a… Depth-first Search (/tag/depth-first-search) 47.5% Me
Union Find (/tag/union-find)
Facebook (/company/facebook)
472 Concatenated Words (/proble… Dynamic Programming (/tag/dynamic-programming) 42.4% Ha
Depth-first Search (/tag/depth-first-search)
Trie (/tag/trie)
314 Binary Tree Vertical Order Tra… Depth-first Search (/tag/depth-first-search) 44.3% Me
Breadth-first Search (/tag/breadth-first-search)
Google (/company/google)
Facebook (/company/facebook)
Snapchat (/company/snapchat)
924 Minimize Malware Spread (/p… Depth-first Search (/tag/depth-first-search) 41.9% Ha
Union Find (/tag/union-find)
Dropbox (/company/dropbox)
733 Flood Fill (/problems/flood-fill) Depth-first Search (/tag/depth-first-search) 54.7% Ea
Uber (/company/uber)
515 Find Largest Value in Each Tr… Tree (/tag/tree) 60.5% Me
Depth-first Search (/tag/depth-first-search)
Breadth-first Search (/tag/breadth-first-search)
LinkedIn (/company/linkedin)
129 Sum Root to Leaf Numbers (/… Tree (/tag/tree) 46.6% Me
Depth-first Search (/tag/depth-first-search)
968 Binary Tree Cameras (/proble… Dynamic Programming (/tag/dynamic-programming) 36.8% Ha
Tree (/tag/tree)
Depth-first Search (/tag/depth-first-search)
Facebook (/company/facebook)
971 Flip Binary Tree To Match Pre… Tree (/tag/tree) 45.0% Me
Depth-first Search (/tag/depth-first-search)
785 Is Graph Bipartite? (/problem… Depth-first Search (/tag/depth-first-search) 46.6% Me
Breadth-first Search (/tag/breadth-first-search)
Graph (/tag/graph)
Facebook (/company/facebook)
1145 Binary Tree Coloring Game (/… Tree (/tag/tree) 51.0% Me
Depth-first Search (/tag/depth-first-search)
[Link] 5/9
26/05/2020 (7) Depth-first Search - LeetCode
# Title Google (/company/google)
Tags Acceptance Diffi
559 Maximum Depth of N-ary Tre… Tree (/tag/tree) 68.0% Ea
Depth-first Search (/tag/depth-first-search)
Breadth-first Search (/tag/breadth-first-search)
1236 Web Crawler (/problems/web… Depth-first Search (/tag/depth-first-search) 63.8% Me
Breadth-first Search (/tag/breadth-first-search)
Facebook (/company/facebook)
Dropbox (/company/dropbox)
778 Swim in Rising Water (/proble… Binary Search (/tag/binary-search) 52.1% Ha
Heap (/tag/heap)
Depth-first Search (/tag/depth-first-search)
Union Find (/tag/union-find)
Google (/company/google)
802 Find Eventual Safe States (/pr… Depth-first Search (/tag/depth-first-search) 47.9% Me
Graph (/tag/graph) Google (/company/google)
934 Shortest Bridge (/problems/s… Depth-first Search (/tag/depth-first-search) 46.7% Me
Breadth-first Search (/tag/breadth-first-search)
McKinsey (/company/mckinsey)
1123 Lowest Common Ancestor of… Tree (/tag/tree) 66.6% Me
Depth-first Search (/tag/depth-first-search)
Facebook (/company/facebook)
694 Number of Distinct Islands (/… Hash Table (/tag/hash-table) 55.2% Me
Depth-first Search (/tag/depth-first-search)
Amazon (/company/amazon)
1028 Recover a Tree From Preorde… Tree (/tag/tree) 69.6% Ha
Depth-first Search (/tag/depth-first-search)
Amazon (/company/amazon)
490 The Maze (/problems/the-maze) Depth-first Search (/tag/depth-first-search) 50.8% Me
Breadth-first Search (/tag/breadth-first-search)
Google (/company/google)
756 Pyramid Transition Matrix (/pr… Bit Manipulation (/tag/bit-manipulation) 54.2% Me
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
Airbnb (/company/airbnb)
1203 Sort Items by Groups Respec… Depth-first Search (/tag/depth-first-search) 47.1% Ha
Graph (/tag/graph)
Topological Sort (/tag/topological-sort)
491 Increasing Subsequences (/p… Depth-first Search (/tag/depth-first-search) 45.1% Me
Yahoo (/company/yahoo)
928 Minimize Malware Spread II (/… Depth-first Search (/tag/depth-first-search) 40.1% Ha
Union Find (/tag/union-find) Graph (/tag/graph)
Dropbox (/company/dropbox)
685 Redundant Connection II (/pr… Tree (/tag/tree) 32.2% Ha
Depth-first Search (/tag/depth-first-search)
Union Find (/tag/union-find) Graph (/tag/graph)
Google (/company/google)
841 Keys and Rooms (/problems/… Depth-first Search (/tag/depth-first-search) 63.5% Me
Graph (/tag/graph) Google (/company/google)
[Link] 6/9
26/05/2020 (7) Depth-first Search - LeetCode
# Title Tags Acceptance Diffi
1302 Deepest Leaves Sum (/proble… Tree (/tag/tree) 83.5% Me
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
488 Zuma Game (/problems/zum… Depth-first Search (/tag/depth-first-search) 40.0% Ha
Baidu (/company/baidu)
1254 Number of Closed Islands (/p… Depth-first Search (/tag/depth-first-search) 59.6% Me
Google (/company/google)
1026 Maximum Difference Betwee… Tree (/tag/tree) 64.6% Me
Depth-first Search (/tag/depth-first-search)
Amazon (/company/amazon)
323 Number of Connected Comp… Depth-first Search (/tag/depth-first-search) 55.2% Me
Breadth-first Search (/tag/breadth-first-search)
Union Find (/tag/union-find) Graph (/tag/graph)
Google (/company/google)
Twitter (/company/twitter)
261 Graph Valid Tree (/problems/… Depth-first Search (/tag/depth-first-search) 41.7% Me
Breadth-first Search (/tag/breadth-first-search)
Union Find (/tag/union-find) Graph (/tag/graph)
Google (/company/google)
Facebook (/company/facebook)
Zenefits (/company/zenefits)
711 Number of Distinct Islands II (… Hash Table (/tag/hash-table) 46.9% Ha
Depth-first Search (/tag/depth-first-search)
Amazon (/company/amazon)
737 Sentence Similarity II (/proble… Depth-first Search (/tag/depth-first-search) 45.5% Me
Union Find (/tag/union-find)
Google (/company/google)
514 Freedom Trail (/problems/free… Divide and Conquer (/tag/divide-and-conquer) 42.5% Ha
Dynamic Programming (/tag/dynamic-programming)
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
1315 Sum of Nodes with Even-Valu… Tree (/tag/tree) 83.6% Me
Depth-first Search (/tag/depth-first-search)
Amazon (/company/amazon)
505 The Maze II (/problems/the-m… Depth-first Search (/tag/depth-first-search) 47.2% Me
Breadth-first Search (/tag/breadth-first-search)
Google (/company/google)
473 Matchsticks to Square (/probl… Depth-first Search (/tag/depth-first-search) 37.2% Me
Rackspace (/company/rackspace)
1242 Web Crawler Multithreaded (/… Depth-first Search (/tag/depth-first-search) 43.9% Me
Breadth-first Search (/tag/breadth-first-search)
Facebook (/company/facebook)
Dropbox (/company/dropbox)
827 Making A Large Island (/probl… Depth-first Search (/tag/depth-first-search) 45.0% Ha
Uber (/company/uber)
839 Similar String Groups (/proble… Depth-first Search (/tag/depth-first-search) 38.2% Ha
Union Find (/tag/union-find) Graph (/tag/graph)
[Link] 7/9
26/05/2020 (7) Depth-first Search - LeetCode
# Title Google (/company/google)
Tags Acceptance Diffi
1034 Coloring A Border (/problems… Depth-first Search (/tag/depth-first-search) 44.6% Me
Booking (/company/booking)
576 Out of Boundary Paths (/prob… Dynamic Programming (/tag/dynamic-programming) 34.5% Me
Depth-first Search (/tag/depth-first-search)
Baidu (/company/baidu)
439 Ternary Expression Parser (/p… Stack (/tag/stack) 55.6% Me
Depth-first Search (/tag/depth-first-search)
Snapchat (/company/snapchat)
1102 Path With Maximum Minimu… Depth-first Search (/tag/depth-first-search) 49.1% Me
Union Find (/tag/union-find) Graph (/tag/graph)
Amazon (/company/amazon)
1061 Lexicographically Smallest E… Depth-first Search (/tag/depth-first-search) 64.7% Me
Union Find (/tag/union-find)
886 Possible Bipartition (/problem… Depth-first Search (/tag/depth-first-search) 43.4% Me
Microsoft (/company/microsoft)
1376 Time Needed to Inform All E… Depth-first Search (/tag/depth-first-search) 55.1% Me
Google (/company/google)
1020 Number of Enclaves (/proble… Depth-first Search (/tag/depth-first-search) 56.5% Me
Google (/company/google)
988 Smallest String Starting From… Tree (/tag/tree) 45.4% Me
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
1245 Tree Diameter (/problems/tree… Tree (/tag/tree) 58.7% Me
Depth-first Search (/tag/depth-first-search)
Breadth-first Search (/tag/breadth-first-search)
Google (/company/google)
1273 Delete Tree Nodes (/problems… Dynamic Programming (/tag/dynamic-programming) 62.9% Me
Depth-first Search (/tag/depth-first-search)
Microsoft (/company/microsoft)
499 The Maze III (/problems/the-… Depth-first Search (/tag/depth-first-search) 40.3% Ha
Breadth-first Search (/tag/breadth-first-search)
851 Loud and Rich (/problems/lou… Depth-first Search (/tag/depth-first-search) 50.9% Me
Amazon (/company/amazon)
1136 Parallel Courses (/problems/p… Dynamic Programming (/tag/dynamic-programming) 60.8% Ha
Depth-first Search (/tag/depth-first-search)
Graph (/tag/graph) Google (/company/google)
1080 Insufficient Nodes in Root to … Depth-first Search (/tag/depth-first-search) 48.6% Me
Amazon (/company/amazon)
531 Lonely Pixel I (/problems/lone… Array (/tag/array) 58.7% Me
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
533 Lonely Pixel II (/problems/lon… Array (/tag/array) 47.4% Me
Depth-first Search (/tag/depth-first-search)
Google (/company/google)
1391 Check if There is a Valid Path… Depth-first Search (/tag/depth-first-search) 44.7% Me
Breadth-first Search (/tag/breadth-first-search)
[Link] 8/9
26/05/2020 (7) Depth-first Search - LeetCode
# Title Robinhood (/company/robinhood)
Tags Acceptance Diffi
1319 Number of Operations to Ma… Depth-first Search (/tag/depth-first-search) 51.8% Me
Breadth-first Search (/tag/breadth-first-search)
Union Find (/tag/union-find)
Akuna Capital (/company/akuna-capital)
1443 Minimum Time to Collect All … Tree (/tag/tree) 57.6% Me
Depth-first Search (/tag/depth-first-search)
Facebook (/company/facebook)
1339 Maximum Product of Splitted… Dynamic Programming (/tag/dynamic-programming) 36.3% Me
Tree (/tag/tree)
Depth-first Search (/tag/depth-first-search)
Microsoft (/company/microsoft)
1059 All Paths from Source Lead t… Depth-first Search (/tag/depth-first-search) 45.3% Me
Graph (/tag/graph) Google (/company/google)
1377 Frog Position After T Second… Depth-first Search (/tag/depth-first-search) 33.1% Ha
Google (/company/google)
1457 Pseudo-Palindromic Paths in … Bit Manipulation (/tag/bit-manipulation) 66.2% Me
Tree (/tag/tree)
Depth-first Search (/tag/depth-first-search)
Amazon (/company/amazon)
1448 Count Good Nodes in Binary … Tree (/tag/tree) 69.9% Me
Depth-first Search (/tag/depth-first-search)
Microsoft (/company/microsoft)
Copyright © 2020 LeetCode Help Center (/support/) | Terms (/terms/) | Privacy (/privacy/) United States
(/region/)
[Link] 9/9