PhantomCodeAIPhantomCodeAI
FeaturesMock InterviewDashboardJobsPricing
FeaturesMock InterviewDashboardJobsPricing
PhantomCodeAIPhantomCodeAI
FeaturesMock InterviewDashboardJobsPricing
FeaturesMock InterviewDashboardJobsPricing
HomeLeetCode ProblemsDepth-First Search

Depth-First Search Problems

253 Depth-First Search LeetCode problems · Solve with AI-powered hints & step-by-step explanations.

79Word SearchMedium94Binary Tree Inorder TraversalEasy98Validate Binary Search TreeMedium99Recover Binary Search TreeMedium100Same TreeEasy101Symmetric TreeEasy104Maximum Depth of Binary TreeEasy110Balanced Binary TreeEasy111Minimum Depth of Binary TreeEasy112Path SumEasy113Path Sum IIMedium114Flatten Binary Tree to Linked ListMedium116Populating Next Right Pointers in Each NodeMedium117Populating Next Right Pointers in Each Node IIMedium124Binary Tree Maximum Path SumHard129Sum Root to Leaf NumbersMedium130Surrounded RegionsMedium133Clone GraphMedium144Binary Tree Preorder TraversalEasy145Binary Tree Postorder TraversalEasy199Binary Tree Right Side ViewMedium200Number of IslandsMedium207Course ScheduleMedium210Course Schedule IIMedium211Design Add and Search Words Data StructureMedium226Invert Binary TreeEasy230Kth Smallest Element in a BSTMedium235Lowest Common Ancestor of a Binary Search TreeMedium236Lowest Common Ancestor of a Binary TreeMedium257Binary Tree PathsEasy297Serialize and Deserialize Binary TreeHard310Minimum Height TreesMedium329Longest Increasing Path in a MatrixHard332Reconstruct ItineraryHard337House Robber IIIMedium341Flatten Nested List IteratorMedium365Water and Jug ProblemMedium385Mini ParserMedium386Lexicographical NumbersMedium388Longest Absolute File PathMedium399Evaluate DivisionMedium404Sum of Left LeavesEasy417Pacific Atlantic Water FlowMedium419Battleships in a BoardMedium430Flatten a Multilevel Doubly Linked ListMedium437Path Sum IIIMedium449Serialize and Deserialize BSTMedium463Island PerimeterEasy472Concatenated WordsHard501Find Mode in Binary Search TreeEasy508Most Frequent Subtree SumMedium513Find Bottom Left Tree ValueMedium514Freedom TrailHard515Find Largest Value in Each Tree RowMedium529MinesweeperMedium530Minimum Absolute Difference in BSTEasy538Convert BST to Greater TreeMedium543Diameter of Binary TreeEasy547Number of ProvincesMedium559Maximum Depth of N-ary TreeEasy563Binary Tree TiltEasy565Array NestingMedium572Subtree of Another TreeEasy589N-ary Tree Preorder TraversalEasy590N-ary Tree Postorder TraversalEasy606Construct String from Binary TreeMedium617Merge Two Binary TreesEasy623Add One Row to TreeMedium637Average of Levels in Binary TreeEasy652Find Duplicate SubtreesMedium653Two Sum IV - Input is a BSTEasy655Print Binary TreeMedium662Maximum Width of Binary TreeMedium669Trim a Binary Search TreeMedium671Second Minimum Node In a Binary TreeEasy672Bulb Switcher IIMedium676Implement Magic DictionaryMedium684Redundant ConnectionMedium685Redundant Connection IIHard687Longest Univalue PathMedium690Employee ImportanceMedium695Max Area of IslandMedium721Accounts MergeMedium733Flood FillEasy743Network Delay TimeMedium749Contain VirusHard753Cracking the SafeHard756Pyramid Transition MatrixMedium765Couples Holding HandsHard778Swim in Rising WaterHard783Minimum Distance Between BST NodesEasy785Is Graph Bipartite?Medium787Cheapest Flights Within K StopsMedium797All Paths From Source to TargetMedium802Find Eventual Safe StatesMedium814Binary Tree PruningMedium827Making A Large IslandHard834Sum of Distances in TreeHard839Similar String GroupsHard841Keys and RoomsMedium851Loud and RichMedium863All Nodes Distance K in Binary TreeMedium865Smallest Subtree with all the Deepest NodesMedium872Leaf-Similar TreesEasy886Possible BipartitionMedium897Increasing Order Search TreeEasy924Minimize Malware SpreadHard928Minimize Malware Spread IIHard934Shortest BridgeMedium938Range Sum of BSTEasy947Most Stones Removed with Same Row or ColumnMedium951Flip Equivalent Binary TreesMedium959Regions Cut By SlashesMedium965Univalued Binary TreeEasy968Binary Tree CamerasHard971Flip Binary Tree To Match Preorder TraversalMedium979Distribute Coins in Binary TreeMedium987Vertical Order Traversal of a Binary TreeHard988Smallest String Starting From LeafMedium993Cousins in Binary TreeEasy1020Number of EnclavesMedium1022Sum of Root To Leaf Binary NumbersEasy1026Maximum Difference Between Node and AncestorMedium1028Recover a Tree From Preorder TraversalHard1034Coloring A BorderMedium1036Escape a Large MazeHard1038Binary Search Tree to Greater Sum TreeMedium1042Flower Planting With No AdjacentMedium1080Insufficient Nodes in Root to Leaf PathsMedium1110Delete Nodes And Return ForestMedium1123Lowest Common Ancestor of Deepest LeavesMedium1145Binary Tree Coloring GameMedium1161Maximum Level Sum of a Binary TreeMedium1192Critical Connections in a NetworkHard1202Smallest String With SwapsMedium1203Sort Items by Groups Respecting DependenciesHard1233Remove Sub-Folders from the FilesystemMedium1254Number of Closed IslandsMedium1261Find Elements in a Contaminated Binary TreeMedium1267Count Servers that CommunicateMedium1302Deepest Leaves SumMedium1305All Elements in Two Binary Search TreesMedium1306Jump Game IIIMedium1315Sum of Nodes with Even-Valued GrandparentMedium1319Number of Operations to Make Network ConnectedMedium1325Delete Leaves With a Given ValueMedium1339Maximum Product of Splitted Binary TreeMedium1361Validate Binary Tree NodesMedium1367Linked List in Binary TreeMedium1372Longest ZigZag Path in a Binary TreeMedium1373Maximum Sum BST in Binary TreeHard1376Time Needed to Inform All EmployeesMedium1377Frog Position After T SecondsHard1379Find a Corresponding Node of a Binary Tree in a Clone of That TreeEasy1382Balance a Binary Search TreeMedium1391Check if There is a Valid Path in a GridMedium1443Minimum Time to Collect All Apples in a TreeMedium1448Count Good Nodes in Binary TreeMedium1457Pseudo-Palindromic Paths in a Binary TreeMedium1462Course Schedule IVMedium1466Reorder Routes to Make All Paths Lead to the City ZeroMedium1483Kth Ancestor of a Tree NodeHard1519Number of Nodes in the Sub-Tree With the Same LabelMedium1530Number of Good Leaf Nodes PairsMedium1559Detect Cycles in 2D GridMedium1568Minimum Number of Days to Disconnect IslandHard1600Throne InheritanceMedium1625Lexicographically Smallest String After Applying OperationsMedium1631Path With Minimum EffortMedium1722Minimize Hamming Distance After Swap OperationsMedium1743Restore the Array From Adjacent PairsMedium1766Tree of CoprimesHard1905Count Sub IslandsMedium1932Merge BSTs to Create Single BSTHard1938Maximum Genetic Difference QueryHard1970Last Day Where You Can Still CrossHard1971Find if Path Exists in GraphEasy1992Find All Groups of FarmlandMedium1993Operations on TreeMedium2003Smallest Missing Genetic Value in Each SubtreeHard2049Count Nodes With the Highest ScoreMedium2092Find All People With SecretHard2096Step-By-Step Directions From a Binary Tree Node to AnotherMedium2097Valid Arrangement of PairsHard2101Detonate the Maximum BombsMedium2127Maximum Employees to Be Invited to a MeetingHard2192All Ancestors of a Node in a Directed Acyclic GraphMedium2246Longest Path With Different Adjacent CharactersHard2265Count Nodes Equal to Average of SubtreeMedium2316Count Unreachable Pairs of Nodes in an Undirected GraphMedium2322Minimum Score After Removals on a TreeHard2328Number of Increasing Paths in a GridHard2331Evaluate Boolean Binary TreeEasy2359Find Closest Node to Given Two NodesMedium2360Longest Cycle in a GraphHard2368Reachable Nodes With RestrictionsMedium2385Amount of Time for Binary Tree to Be InfectedMedium2415Reverse Odd Levels of Binary TreeMedium2440Create Components With Same ValueHard2458Height of Binary Tree After Subtree Removal QueriesHard2467Most Profitable Path in a TreeMedium2476Closest Nodes Queries in a Binary Search TreeMedium2477Minimum Fuel Cost to Report to the CapitalMedium2492Minimum Score of a Path Between Two CitiesMedium2493Divide Nodes Into the Maximum Number of GroupsHard2538Difference Between Maximum and Minimum Price SumHard2556Disconnect Path in a Binary Matrix by at Most One FlipMedium2581Count Number of Possible Root NodesHard2596Check Knight Tour ConfigurationMedium2641Cousins in Binary Tree IIMedium2646Minimize the Total Price of the TripsHard2658Maximum Number of Fish in a GridMedium2685Count the Number of Complete ComponentsMedium2791Count Paths That Can Form a Palindrome in a TreeHard2858Minimum Edge Reversals So Every Node Is ReachableHard2867Count Valid Paths in a TreeHard2872Maximum Number of K-Divisible ComponentsHard2920Maximum Points After Collecting Coins From All NodesHard2925Maximum Score After Applying Operations on a TreeMedium2973Find Number of Coins to Place in Tree NodesHard3067Count Pairs of Connectable Servers in a Weighted Tree NetworkMedium3123Find Edges in Shortest PathsHard3203Find Minimum Diameter After Merging Two TreesHard3235Check if the Rectangle Corner Is ReachableHard3241Time Taken to Mark All NodesHard3249Count the Number of Good NodesMedium3310Remove Methods From ProjectMedium3319K-th Largest Perfect Subtree Size in Binary TreeMedium3327Check if DFS Strings Are PalindromesHard3331Find Subtree Sizes After ChangesMedium3367Maximize Sum of Weights after Edge RemovalsHard3372Maximize the Number of Target Nodes After Connecting Trees IMedium3373Maximize the Number of Target Nodes After Connecting Trees IIHard3376Minimum Time to Break Locks IMedium3387Maximize Amount After Two Days of ConversionsMedium3419Minimize the Maximum Edge Weight of GraphMedium3425Longest Special PathHard3486Longest Special Path IIHard3493Properties GraphMedium3515Shortest Path in a Weighted TreeHard3528Unit Conversion IMedium3544Subtree Inversion SumHard3547Maximum Sum of Edge Values in a GraphHard3553Minimum Weighted Subgraph With the Required Paths IIHard3558Number of Ways to Assign Edge Weights IMedium3559Number of Ways to Assign Edge Weights IIHard3562Maximum Profit from Trading Stocks with DiscountsHard3575Maximum Good Subtree ScoreHard3585Find Weighted Median Node in TreeHard3590Kth Smallest Path XOR SumHard3593Minimum Increments to Equalize Leaf PathsMedium3607Power Grid MaintenanceMedium3619Count Islands With Total Value Divisible by KMedium
← Browse all LeetCode problems
PhantomCodeAIPhantomCodeAI
PhantomCodeAI is an undetectable desktop application to help you pass your Leetcode interviews.
All systems online
Download

Legal

Refund PolicyTerms of ServiceCancellation PolicyPrivacy Policy

Pages

Contact SupportHelp CenterInstant SupportFAQBlogFeaturesInterview CopilotCoding CopilotInterview QuestionsPricingMock Interview PricingEarn with UsBest AI Interview Assistants 2026FeedbackLeetcode ProblemsLoginCreate Account

Compare

All 29 comparisons →Why switch (29 alternatives) →Interview Coder AlternativeFinal Round AI AlternativeUltraCode AI AlternativeParakeet AI AlternativeAI Apply AlternativeCoderRank AlternativeInterviewing.io AlternativeShadeCoder Alternative

Resources

Salary GuideResume TemplatesWhat Is PhantomCodeAIIs PhantomCodeAI Detectable?Use PhantomCodeAI in HackerRankvs LeetCode PremiumFor European EngineersFor FAANG Interview PrepPost-Layoff ComebackIndia Pricing (INR)

Interview Types

Coding InterviewSystem Design InterviewDSA InterviewLeetCode InterviewAlgorithms InterviewData Structure InterviewSQL InterviewOnline Assessment

Interview Questions

See all →
GoogleAmazonMetaMicrosoftAppleNetflixStripeUberAirbnbBloombergSoftware EngineerFrontend EngineerBackend EngineerData EngineerML EngineerDevOps EngineerData ScientistEngineering ManagerBehavioralSystem Design

Mock Interview by Round Type

All formats →
Mock Interview HubMock Coding InterviewMock Behavioral InterviewMock System Design

AI for Industry Interviews

All industries →
Sales InterviewsPM InterviewsFinance InterviewsConsulting InterviewsDesign Interviews

Coding Interview Patterns

See all patterns →
Coding Interviews HubDynamic ProgrammingTwo Pointers + Sliding WindowGraph AlgorithmsTree AlgorithmsBinary Search

Interview Guides

See all guides →
How to Ace an InterviewHow to Crack InterviewsBest Interview AnswersScreening Interview QuestionsTelephone Interview TipsWorking Interview ExplainedCracking the PM InterviewFAANG 30-Day RoadmapTop 10 LeetCode PatternsSystem Design Prep GuideSTAR Behavioral MethodBehavioral Interview Qs

Alternatives — why engineers switch

See all 29 →
Interview CoderFinal Round AIParakeet AILockedIn AIUltraCode AIShadeCoderSensei AIVerve AICluelyChatGPTBeyz AIInterview SidekickYoodliAlgoMonsterCoderRankExponentFormationInterviewing.ioInterview CakeBig InterviewInterview KickstartPrampScalerAI ApplyCareerflowJobscanKickresumeTeal HQHireVue

AI Interview Tools

AI Interview AssistantAI Interview CoachAI for Job InterviewsAI Interview Preparation ToolReal-Time AI Interview AnswersInterview AI HelperReal-Time AI Interview AssistantAI Interview BotBest AI Interview Tools 2026AI Interview QuestionsPractice Interview QuestionsAI to Answer Interview QuestionsAI Phone Interview HelpAI Interviewing SoftwareAI Interview HubInterview CopilotAI Coding Interview AssistantMock Interview

© 2026 PhantomCodeAI. All rights reserved.