Algorithms > Search¶
Binary Search¶
- 981. Time Based Key-Value Store
- 911. Online Election
- 902. Numbers At Most N Given Digit Set
- 888. Fair Candy Swap
- 887. Super Egg Drop
- 878. Nth Magical Number
- 875. Koko Eating Bananas
- 862. Shortest Subarray with Sum at Least K
- 852. Peak Index in a Mountain Array
- 826. Most Profit Assigning Work
- 825. Friends Of Appropriate Ages
- 81. Search in Rotated Sorted Array II
- 793. Preimage Size of Factorial Zeroes Function
- 792. Number of Matching Subsequences
- 786. K-th Smallest Prime Fraction
- 778. Swim in Rising Water
- 774. Minimize Max Distance to Gas Station
- 754. Reach a Number
- 744. Find Smallest Letter Greater Than Target
- 74. Search a 2D Matrix
- 732. My Calendar III
- 731. My Calendar II
- 729. My Calendar I
- 719. Find K-th Smallest Pair Distance
- 718. Maximum Length of Repeated Subarray
- 713. Subarray Product Less Than K
- 710. Random Pick with Blacklist
- 704. Binary Search
- 702. Search in a Sorted Array of Unknown Size
- 69. Sqrt(x)
- 668. Kth Smallest Number in Multiplication Table
- 658. Find K Closest Elements
- 644. Maximum Average Subarray II
- 633. Sum of Square Numbers
- 611. Valid Triangle Number
- 540. Single Element in a Sorted Array
- 532. K-diff Pairs in an Array
- 497. Random Point in Non-overlapping Rectangles
- 493. Reverse Pairs
- 483. Smallest Good Base
- 475. Heaters
- 456. 132 Pattern
- 441. Arranging Coins
- 436. Find Right Interval
- 410. Split Array Largest Sum
- 400. Nth Digit
- 4. Median of Two Sorted Arrays
- 378. Kth Smallest Element in a Sorted Matrix
- 374. Guess Number Higher or Lower
- 367. Valid Perfect Square
- 363. Max Sum of Rectangle No Larger Than K
- 362. Design Hit Counter
- 354. Russian Doll Envelopes
- 352. Data Stream as Disjoint Intervals
- 3501. Maximize Active Section with Trade II
- 350. Intersection of Two Arrays II
- 35. Search Insert Position
- 349. Intersection of Two Arrays
- 3488. Closest Equal Element Queries
- 3479. Fruits Into Baskets III
- 3477. Fruits Into Baskets II
- 3464. Maximize the Distance Between Points on a Square
- 3455. Shortest Matching Substring
- 3454. Separate Squares II
- 3453. Separate Squares I
- 3449. Maximize the Minimum Game Score
- 3419. Minimize the Maximum Edge Weight of Graph
- 3414. Maximum Score of Non-overlapping Intervals
- 3413. Maximum Coins From K Consecutive Bags
- 34. Find First and Last Position of Element in Sorted Array
- 3399. Smallest Substring With Identical Characters II
- 3398. Smallest Substring With Identical Characters I
- 3369. Design an Array Statistics Tracker
- 3357. Minimize the Maximum Adjacent Element Difference
- 3356. Zero Array Transformation II
- 3350. Adjacent Increasing Subarrays Detection II
- 3347. Maximum Frequency of an Element After Performing Operations II
- 3346. Maximum Frequency of an Element After Performing Operations I
- 3344. Maximum Sized Array
- 3323. Minimize Connected Groups by Inserting Interval
- 3312. Sorted GCD Pair Queries
- 33. Search in Rotated Sorted Array
- 3296. Minimum Number of Seconds to Make Mountain Height Zero
- 3292. Minimum Number of Valid Strings to Form Target II
- 3291. Minimum Number of Valid Strings to Form Target I
- 3288. Length of the Longest Increasing Path
- 3281. Maximize Score of Numbers in Ranges
- 327. Count of Range Sum
- 3261. Count Substrings That Satisfy K-Constraint II
- 3231. Minimum Number of Increasing Subsequence to Be Removed
- 3209. Number of Subarrays With AND Value of K
- 3186. Maximum Total Damage With Spell Casting
- 3171. Find Subarray With Bitwise OR Closest to K
- 3161. Block Placement Queries
- 3155. Maximum Number of Upgradable Servers
- 3152. Special Array II
- 315. Count of Smaller Numbers After Self
- 3145. Find Products of Elements of Big Array
- 3143. Maximum Points Inside the Square
- 3135. Equalize Strings by Adding or Removing Characters at Ends
- 3134. Find the Median of the Uniqueness Array
- 3117. Minimum Sum of Values by Dividing Array
- 3116. Kth Smallest Amount With Single Denomination Combination
- 3113. Find the Number of Subarrays Where Boundary Elements Are Maximum
- 3109. Find the Index of Permutation
- 3104. Find Longest Self-Contained Substring
- 3049. Earliest Second to Mark Indices II
- 3048. Earliest Second to Mark Indices I
- 302. Smallest Rectangle Enclosing Black Pixels
- 3008. Find Beautiful Indices in the Given Array II
- 3007. Maximum Number That Sum of the Prices Is Less Than or Equal to K
- 3006. Find Beautiful Indices in the Given Array I
- 300. Longest Increasing Subsequence
- 2982. Find Longest Special Substring That Occurs Thrice II
- 2981. Find Longest Special Substring That Occurs Thrice I
- 2972. Count the Number of Incremovable Subarrays II
- 2970. Count the Number of Incremovable Subarrays I
- 2968. Apply Operations to Maximize Frequency Score
- 2967. Minimum Cost to Make Array Equalindromic
- 2945. Find Maximum Non-decreasing Array Length
- 2941. Maximum GCD-Sum of a Subarray
- 2940. Find Building Where Alice and Bob Can Meet
- 2936. Number of Equal Numbers Blocks
- 2926. Maximum Balanced Subsequence Sum
- 287. Find the Duplicate Number
- 2861. Maximum Number of Alloys
- 2856. Minimum Array Length After Pair Removals
- 2838. Maximum Coins Heroes Can Collect
- 2831. Find the Longest Equal Subarray
- 2830. Maximize the Profit as the Salesman
- 2826. Sorting Three Groups
- 2824. Count Pairs Whose Sum is Less than Target
- 2819. Minimum Relative Loss After Buying Chocolates
- 2817. Minimum Absolute Difference Between Elements With Constraint
- 2812. Find the Safest Path in a Grid
- 2790. Maximum Number of Groups With Increasing Length
- 278. First Bad Version
- 2779. Maximum Beauty of an Array After Applying Operation
- 275. H-Index II
- 2736. Maximum Sum Queries
- 2713. Maximum Strictly Increasing Cells in a Matrix
- 2702. Minimum Operations to Make Numbers Non-positive
- 270. Closest Binary Search Tree Value
- 268. Missing Number
- 2659. Make Array Empty
- 2616. Minimize the Maximum Difference of Pairs
- 2604. Minimum Time to Eat All Grains
- 2602. Minimum Operations to Make All Array Elements Equal
- 2601. Prime Subtraction Operation
- 2594. Minimum Time to Repair Cars
- 259. 3Sum Smaller
- 2589. Minimum Time to Complete All Tasks
- 2576. Find the Maximum Number of Marked Indices
- 2565. Subsequence With the Minimum Score
- 2563. Count the Number of Fair Pairs
- 2560. House Robber IV
- 2557. Maximum Number of Integers to Choose From a Range II
- 2555. Maximize Win From Two Segments
- 2554. Maximum Number of Integers to Choose From a Range I
- 2540. Minimum Common Value
- 2529. Maximum Count of Positive Integer and Negative Integer
- 2528. Maximize the Minimum Powered City
- 2519. Count the Number of K-Big Indices
- 2517. Maximum Tastiness of Candy Basket
- 2513. Minimize the Maximum of Two Arrays
- 2501. Longest Square Streak in an Array
- 2498. Frog Jump II
- 2476. Closest Nodes Queries in a Binary Search Tree
- 2468. Split Message Based on Limit
- 2454. Next Greater Element IV
- 2448. Minimum Cost to Make Array Equal
- 2439. Minimize Maximum of Array
- 2426. Number of Pairs Satisfying Inequality
- 2424. Longest Uploaded Prefix
- 2411. Smallest Subarrays With Maximum Bitwise OR
- 240. Search a 2D Matrix II
- 2398. Maximum Number of Robots Within Budget
- 2389. Longest Subsequence With Limited Sum
- 2387. Median of a Row Wise Sorted Matrix
- 2358. Maximum Number of Groups Entering a Competition
- 2354. Number of Excellent Pairs
- 2333. Minimum Sum of Squared Difference
- 2332. The Latest Time to Catch a Bus
- 2302. Count Subarrays With Score Less Than K
- 2300. Successful Pairs of Spells and Potions
- 2286. Booking Concert Tickets in Groups
- 2271. Maximum White Tiles Covered by a Carpet
- 2258. Escape the Spreading Fire
- 2251. Number of Flowers in Full Bloom
- 2250. Count Number of Rectangles Containing Each Point
- 2234. Maximum Total Beauty of the Gardens
- 2226. Maximum Candies Allocated to K Children
- 2223. Sum of Scores of Built Strings
- 222. Count Complete Tree Nodes
- 2187. Minimum Time to Complete Trips
- 2179. Count Good Triplets in an Array
- 2141. Maximum Running Time of N Computers
- 2137. Pour Water Between Buckets to Make Water Levels Equal
- 2111. Minimum Operations to Make the Array K-Increasing
- 2106. Maximum Fruits Harvested After at Most K Steps
- 209. Minimum Size Subarray Sum
- 2089. Find Target Indices After Sorting Array
- 2080. Range Frequency Queries
- 2071. Maximum Number of Tasks You Can Assign
- 2070. Most Beautiful Item for Each Query
- 2064. Minimized Maximum of Products Distributed to Any Store
- 2055. Plates Between Candles
- 2054. Two Best Non-Overlapping Events
- 2040. Kth Smallest Product of Two Sorted Arrays
- 2035. Partition Array Into Two Arrays to Minimize Sum Difference
- 2031. Count Subarrays With More Ones Than Zeros
- 2024. Maximize the Confusion of an Exam
- 2009. Minimum Number of Operations to Make Array Continuous
- 2008. Maximum Earnings From Taxi
- 1970. Last Day Where You Can Still Cross
- 1966. Binary Searchable Numbers in an Unsorted Array
- 1964. Find the Longest Valid Obstacle Course at Each Position
- 1956. Minimum Time For K Virus Variants to Spread
- 1954. Minimum Garden Perimeter to Collect Enough Apples
- 1932. Merge BSTs to Create Single BST
- 1923. Longest Common Subpath
- 1918. Kth Smallest Subarray Sum
- 1901. Find a Peak Element II
- 1898. Maximum Number of Removable Characters
- 1894. Find the Student that Will Replace the Chalk
- 1891. Cutting Ribbons
- 1889. Minimum Space Wasted From Packaging
- 1885. Count Pairs in Two Arrays
- 1870. Minimum Speed to Arrive on Time
- 1862. Sum of Floored Pairs
- 1855. Maximum Distance Between a Pair of Values
- 1851. Minimum Interval to Include Each Query
- 1847. Closest Room
- 1838. Frequency of the Most Frequent Element
- 1818. Minimum Absolute Sum Difference
- 1802. Maximum Value at a Given Index in a Bounded Array
- 1793. Maximum Score of a Good Subarray
- 1782. Count Pairs Of Nodes
- 1760. Minimum Limit of Balls in a Bag
- 1751. Maximum Number of Events That Can Be Attended II
- 1739. Building Boxes
- 1713. Minimum Operations to Make a Subsequence
- 1712. Ways to Split Array Into Three Subarrays
- 1671. Minimum Number of Removals to Make Mountain Array
- 167. Two Sum II - Input Array Is Sorted
- 1658. Minimum Operations to Reduce X to Zero
- 1649. Create Sorted Array through Instructions
- 1648. Sell Diminishing-Valued Colored Balls
- 1631. Path With Minimum Effort
- 162. Find Peak Element
- 1618. Maximum Font to Fit a Sentence in a Screen
- 1608. Special Array With X Elements Greater Than or Equal X
- 1574. Shortest Subarray to be Removed to Make Array Sorted
- 1562. Find Latest Group of Size M
- 1552. Magnetic Force Between Two Balls
- 154. Find Minimum in Rotated Sorted Array II
- 1539. Kth Missing Positive Number
- 1533. Find the Index of the Large Integer
- 153. Find Minimum in Rotated Sorted Array
- 1521. Find a Value of a Mysterious Function Closest to Target
- 1508. Range Sum of Sorted Subarray Sums
- 1498. Number of Subsequences That Satisfy the Given Sum Condition
- 1488. Avoid Flood in The City
- 1483. Kth Ancestor of a Tree Node
- 1482. Minimum Number of Days to Make m Bouquets
- 1477. Find Two Non-overlapping Sub-arrays Each With Target Sum
- 1439. Find the Kth Smallest Sum of a Matrix With Sorted Rows
- 1428. Leftmost Column with at Least a One
- 1385. Find the Distance Value Between Two Arrays
- 1351. Count Negative Numbers in a Sorted Matrix
- 1348. Tweet Counts Per Frequency
- 1346. Check If N and Its Double Exist
- 1337. The K Weakest Rows in a Matrix
- 1300. Sum of Mutated Array Closest to Target
- 1292. Maximum Side Length of a Square with Sum Less than or Equal to Threshold
- 1283. Find the Smallest Divisor Given a Threshold
- 1268. Search Suggestions System
- 1237. Find Positive Integer Solution for a Given Equation
- 1235. Maximum Profit in Job Scheduling
- 1231. Divide Chocolate
- 1214. Two Sum BSTs
- 1213. Intersection of Three Sorted Arrays
- 1208. Get Equal Substrings Within Budget
- 1201. Ugly Number III
- 1198. Find Smallest Common Element in All Rows
- 1187. Make Array Strictly Increasing
- 1182. Shortest Distance to Target Color
- 1170. Compare Strings by Frequency of the Smallest Character
- 1157. Online Majority Element In Subarray
- 1150. Check If a Number Is Majority Element in a Sorted Array
- 1146. Snapshot Array
- 1102. Path With Maximum Minimum Value
- 1099. Two Sum Less Than K
- 1095. Find in Mountain Array
- 1064. Fixed Point
- 1062. Longest Repeating Substring
- 1060. Missing Element in Sorted Array
- 1055. Shortest Way to Form String
- 1044. Longest Duplicate Substring
- 1027. Longest Arithmetic Subsequence
- 1011. Capacity To Ship Packages Within D Days
- 1004. Max Consecutive Ones III
Breadth-First Search¶
- 994. Rotting Oranges
- 993. Cousins in Binary Tree
- 987. Vertical Order Traversal of a Binary Tree
- 967. Numbers With Same Consecutive Differences
- 965. Univalued Binary Tree
- 959. Regions Cut By Slashes
- 958. Check Completeness of a Binary Tree
- 934. Shortest Bridge
- 928. Minimize Malware Spread II
- 924. Minimize Malware Spread
- 919. Complete Binary Tree Inserter
- 909. Snakes and Ladders
- 886. Possible Bipartition
- 865. Smallest Subtree with all the Deepest Nodes
- 864. Shortest Path to Get All Keys
- 863. All Nodes Distance K in Binary Tree
- 854. K-Similar Strings
- 847. Shortest Path Visiting All Nodes
- 841. Keys and Rooms
- 839. Similar String Groups
- 827. Making A Large Island
- 815. Bus Routes
- 802. Find Eventual Safe States
- 797. All Paths From Source to Target
- 787. Cheapest Flights Within K Stops
- 785. Is Graph Bipartite?
- 783. Minimum Distance Between BST Nodes
- 778. Swim in Rising Water
- 773. Sliding Puzzle
- 765. Couples Holding Hands
- 756. Pyramid Transition Matrix
- 752. Open the Lock
- 749. Contain Virus
- 743. Network Delay Time
- 742. Closest Leaf in a Binary Tree
- 737. Sentence Similarity II
- 733. Flood Fill
- 721. Accounts Merge
- 711. Number of Distinct Islands II
- 695. Max Area of Island
- 694. Number of Distinct Islands
- 690. Employee Importance
- 685. Redundant Connection II
- 684. Redundant Connection
- 675. Cut Off Trees for Golf Event
- 672. Bulb Switcher II
- 662. Maximum Width of Binary Tree
- 655. Print Binary Tree
- 653. Two Sum IV - Input is a BST
- 637. Average of Levels in Binary Tree
- 623. Add One Row to Tree
- 617. Merge Two Binary Trees
- 582. Kill Process
- 559. Maximum Depth of N-ary Tree
- 547. Number of Provinces
- 542. 01 Matrix
- 530. Minimum Absolute Difference in BST
- 529. Minesweeper
- 515. Find Largest Value in Each Tree Row
- 514. Freedom Trail
- 513. Find Bottom Left Tree Value
- 505. The Maze II
- 499. The Maze III
- 490. The Maze
- 488. Zuma Game
- 463. Island Perimeter
- 449. Serialize and Deserialize BST
- 433. Minimum Genetic Mutation
- 431. Encode N-ary Tree to Binary Tree
- 429. N-ary Tree Level Order Traversal
- 428. Serialize and Deserialize N-ary Tree
- 417. Pacific Atlantic Water Flow
- 407. Trapping Rain Water II
- 404. Sum of Left Leaves
- 399. Evaluate Division
- 365. Water and Jug Problem
- 364. Nested List Weight Sum II
- 3493. Properties Graph
- 3481. Apply Substitutions
- 3419. Minimize the Maximum Edge Weight of Graph
- 339. Nested List Weight Sum
- 3387. Maximize Amount After Two Days of Conversions
- 3383. Minimum Runes to Add to Cast Spell
- 3373. Maximize the Number of Target Nodes After Connecting Trees II
- 3372. Maximize the Number of Target Nodes After Connecting Trees I
- 3310. Remove Methods From Project
- 329. Longest Increasing Path in a Matrix
- 3286. Find a Safe Walk Through a Grid
- 3283. Maximum Number of Moves to Kill All Pawns
- 3243. Shortest Distance After Road Addition Queries I
- 3235. Check if the Rectangle Corner Is Reachable
- 323. Number of Connected Components in an Undirected Graph
- 322. Coin Change
- 3203. Find Minimum Diameter After Merging Two Trees
- 317. Shortest Distance from All Buildings
- 3157. Find the Level of Tree with Minimum Sum
- 3141. Maximum Hamming Distances
- 314. Binary Tree Vertical Order Traversal
- 3123. Find Edges in Shortest Paths
- 310. Minimum Height Trees
- 302. Smallest Rectangle Enclosing Black Pixels
- 3015. Count the Number of Houses at a Certain Distance I
- 301. Remove Invalid Parentheses
- 2998. Minimum Number of Operations to Make X and Y Equal
- 297. Serialize and Deserialize Binary Tree
- 286. Walls and Gates
- 2858. Minimum Edge Reversals So Every Node Is Reachable
- 2852. Sum of Remoteness of All Cells
- 2850. Minimum Moves to Spread Stones Over Grid
- 2814. Minimum Time Takes to Reach Destination Without Drowning
- 2812. Find the Safest Path in a Grid
- 279. Perfect Squares
- 2773. Height of Special Binary Tree
- 269. Alien Dictionary
- 2685. Count the Number of Complete Components
- 2658. Maximum Number of Fish in a Grid
- 2641. Cousins in Binary Tree II
- 2617. Minimum Number of Visited Cells in a Grid
- 2612. Minimum Reverse Operations
- 261. Graph Valid Tree
- 2608. Shortest Cycle in a Graph
- 2596. Check Knight Tour Configuration
- 2583. Kth Largest Sum in a Binary Tree
- 2577. Minimum Time to Visit a Cell In a Grid
- 2556. Disconnect Path in a Binary Matrix by at Most One Flip
- 2503. Maximum Number of Points From Grid Queries
- 2493. Divide Nodes Into the Maximum Number of Groups
- 2492. Minimum Score of a Path Between Two Cities
- 2477. Minimum Fuel Cost to Report to the Capital
- 2471. Minimum Number of Operations to Sort a Binary Tree by Level
- 2467. Most Profitable Path in a Tree
- 2458. Height of Binary Tree After Subtree Removal Queries
- 2445. Number of Nodes With Value One
- 2415. Reverse Odd Levels of Binary Tree
- 2385. Amount of Time for Binary Tree to Be Infected
- 2368. Reachable Nodes With Restrictions
- 2360. Longest Cycle in a Graph
- 2328. Number of Increasing Paths in a Grid
- 2316. Count Unreachable Pairs of Nodes in an Undirected Graph
- 2290. Minimum Obstacle Removal to Reach Corner
- 2277. Closest Node to Path in Tree
- 226. Invert Binary Tree
- 2258. Escape the Spreading Fire
- 2204. Distance to a Cycle in Undirected Graph
- 2192. All Ancestors of a Node in a Directed Acyclic Graph
- 2174. Remove All Ones With Row and Column Flips II
- 2146. K Highest Ranked Items Within a Price Range
- 2101. Detonate the Maximum Bombs
- 210. Course Schedule II
- 2092. Find All People With Secret
- 207. Course Schedule
- 2059. Minimum Operations to Convert Number
- 2045. Second Minimum Time to Reach Destination
- 2039. The Time When the Network Becomes Idle
- 200. Number of Islands
- 1993. Operations on Tree
- 1992. Find All Groups of Farmland
- 199. Binary Tree Right Side View
- 1971. Find if Path Exists in Graph
- 1970. Last Day Where You Can Still Cross
- 1926. Nearest Exit from Entrance in Maze
- 1905. Count Sub Islands
- 1810. Minimum Path Cost in a Hidden Grid
- 1778. Shortest Path in a Hidden Grid
- 1765. Map of Highest Peak
- 1740. Find Distance in a Binary Tree
- 1730. Shortest Path to Get Food
- 1660. Correct a Binary Tree
- 1654. Minimum Jumps to Reach Home
- 1631. Path With Minimum Effort
- 1625. Lexicographically Smallest String After Applying Operations
- 1609. Even Odd Tree
- 1602. Find Nearest Right Node in Binary Tree
- 1568. Minimum Number of Days to Disconnect Island
- 1559. Detect Cycles in 2D Grid
- 1519. Number of Nodes in the Sub-Tree With the Same Label
- 1490. Clone N-ary Tree
- 1485. Clone Binary Tree With Random Pointer
- 1483. Kth Ancestor of a Tree Node
- 1469. Find All The Lonely Nodes
- 1466. Reorder Routes to Make All Paths Lead to the City Zero
- 1462. Course Schedule IV
- 1457. Pseudo-Palindromic Paths in a Binary Tree
- 1448. Count Good Nodes in Binary Tree
- 1443. Minimum Time to Collect All Apples in a Tree
- 1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree
- 1391. Check if There is a Valid Path in a Grid
- 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree
- 1377. Frog Position After T Seconds
- 1376. Time Needed to Inform All Employees
- 1368. Minimum Cost to Make at Least One Valid Path in a Grid
- 1361. Validate Binary Tree Nodes
- 1345. Jump Game IV
- 133. Clone Graph
- 1319. Number of Operations to Make Network Connected
- 1315. Sum of Nodes with Even-Valued Grandparent
- 1311. Get Watched Videos by Your Friends
- 1306. Jump Game III
- 1302. Deepest Leaves Sum
- 130. Surrounded Regions
- 1298. Maximum Candies You Can Get from Boxes
- 1293. Shortest Path in a Grid with Obstacles Elimination
- 1284. Minimum Number of Flips to Convert Binary Matrix to Zero Matrix
- 1273. Delete Tree Nodes
- 127. Word Ladder
- 1267. Count Servers that Communicate
- 1263. Minimum Moves to Move a Box to Their Target Location
- 1261. Find Elements in a Contaminated Binary Tree
- 126. Word Ladder II
- 1257. Smallest Common Region
- 1254. Number of Closed Islands
- 1245. Tree Diameter
- 1242. Web Crawler Multithreaded
- 1236. Web Crawler
- 1215. Stepping Numbers
- 1210. Minimum Moves to Reach Target with Rotations
- 1203. Sort Items by Groups Respecting Dependencies
- 1202. Smallest String With Swaps
- 1197. Minimum Knight Moves
- 117. Populating Next Right Pointers in Each Node II
- 1162. As Far from Land as Possible
- 1161. Maximum Level Sum of a Binary Tree
- 116. Populating Next Right Pointers in Each Node
- 1129. Shortest Path with Alternating Colors
- 1123. Lowest Common Ancestor of Deepest Leaves
- 112. Path Sum
- 111. Minimum Depth of Binary Tree
- 1102. Path With Maximum Minimum Value
- 1096. Brace Expansion II
- 1091. Shortest Path in Binary Matrix
- 1087. Brace Expansion
- 107. Binary Tree Level Order Traversal II
- 1042. Flower Planting With No Adjacent
- 104. Maximum Depth of Binary Tree
- 1036. Escape a Large Maze
- 1034. Coloring A Border
- 103. Binary Tree Zigzag Level Order Traversal
- 1020. Number of Enclaves
- 102. Binary Tree Level Order Traversal
- 101. Symmetric Tree
- 100. Same Tree
Depth-First Search¶
- 993. Cousins in Binary Tree
- 99. Recover Binary Search Tree
- 988. Smallest String Starting From Leaf
- 987. Vertical Order Traversal of a Binary Tree
- 98. Validate Binary Search Tree
- 979. Distribute Coins in Binary Tree
- 971. Flip Binary Tree To Match Preorder Traversal
- 968. Binary Tree Cameras
- 965. Univalued Binary Tree
- 959. Regions Cut By Slashes
- 951. Flip Equivalent Binary Trees
- 947. Most Stones Removed with Same Row or Column
- 94. Binary Tree Inorder Traversal
- 938. Range Sum of BST
- 934. Shortest Bridge
- 928. Minimize Malware Spread II
- 924. Minimize Malware Spread
- 897. Increasing Order Search Tree
- 886. Possible Bipartition
- 872. Leaf-Similar Trees
- 865. Smallest Subtree with all the Deepest Nodes
- 863. All Nodes Distance K in Binary Tree
- 851. Loud and Rich
- 841. Keys and Rooms
- 839. Similar String Groups
- 834. Sum of Distances in Tree
- 827. Making A Large Island
- 814. Binary Tree Pruning
- 802. Find Eventual Safe States
- 797. All Paths From Source to Target
- 79. Word Search
- 787. Cheapest Flights Within K Stops
- 785. Is Graph Bipartite?
- 783. Minimum Distance Between BST Nodes
- 778. Swim in Rising Water
- 765. Couples Holding Hands
- 756. Pyramid Transition Matrix
- 753. Cracking the Safe
- 749. Contain Virus
- 743. Network Delay Time
- 742. Closest Leaf in a Binary Tree
- 737. Sentence Similarity II
- 733. Flood Fill
- 721. Accounts Merge
- 711. Number of Distinct Islands II
- 695. Max Area of Island
- 694. Number of Distinct Islands
- 690. Employee Importance
- 687. Longest Univalue Path
- 685. Redundant Connection II
- 684. Redundant Connection
- 676. Implement Magic Dictionary
- 672. Bulb Switcher II
- 671. Second Minimum Node In a Binary Tree
- 669. Trim a Binary Search Tree
- 666. Path Sum IV
- 663. Equal Tree Partition
- 662. Maximum Width of Binary Tree
- 655. Print Binary Tree
- 653. Two Sum IV - Input is a BST
- 652. Find Duplicate Subtrees
- 642. Design Search Autocomplete System
- 637. Average of Levels in Binary Tree
- 623. Add One Row to Tree
- 617. Merge Two Binary Trees
- 606. Construct String from Binary Tree
- 590. N-ary Tree Postorder Traversal
- 589. N-ary Tree Preorder Traversal
- 582. Kill Process
- 572. Subtree of Another Tree
- 565. Array Nesting
- 563. Binary Tree Tilt
- 559. Maximum Depth of N-ary Tree
- 549. Binary Tree Longest Consecutive Sequence II
- 547. Number of Provinces
- 545. Boundary of Binary Tree
- 543. Diameter of Binary Tree
- 538. Convert BST to Greater Tree
- 536. Construct Binary Tree from String
- 530. Minimum Absolute Difference in BST
- 529. Minesweeper
- 515. Find Largest Value in Each Tree Row
- 514. Freedom Trail
- 513. Find Bottom Left Tree Value
- 508. Most Frequent Subtree Sum
- 505. The Maze II
- 501. Find Mode in Binary Search Tree
- 499. The Maze III
- 490. The Maze
- 472. Concatenated Words
- 463. Island Perimeter
- 449. Serialize and Deserialize BST
- 437. Path Sum III
- 431. Encode N-ary Tree to Binary Tree
- 430. Flatten a Multilevel Doubly Linked List
- 428. Serialize and Deserialize N-ary Tree
- 426. Convert Binary Search Tree to Sorted Doubly Linked List
- 419. Battleships in a Board
- 417. Pacific Atlantic Water Flow
- 404. Sum of Left Leaves
- 399. Evaluate Division
- 388. Longest Absolute File Path
- 386. Lexicographical Numbers
- 385. Mini Parser
- 366. Find Leaves of Binary Tree
- 365. Water and Jug Problem
- 364. Nested List Weight Sum II
- 3493. Properties Graph
- 3486. Longest Special Path II
- 3481. Apply Substitutions
- 3425. Longest Special Path
- 3419. Minimize the Maximum Edge Weight of Graph
- 341. Flatten Nested List Iterator
- 339. Nested List Weight Sum
- 3387. Maximize Amount After Two Days of Conversions
- 3385. Minimum Time to Break Locks II
- 3383. Minimum Runes to Add to Cast Spell
- 3376. Minimum Time to Break Locks I
- 3373. Maximize the Number of Target Nodes After Connecting Trees II
- 3372. Maximize the Number of Target Nodes After Connecting Trees I
- 337. House Robber III
- 3367. Maximize Sum of Weights after Edge Removals
- 3331. Find Subtree Sizes After Changes
- 333. Largest BST Subtree
- 3327. Check if DFS Strings Are Palindromes
- 332. Reconstruct Itinerary
- 3319. K-th Largest Perfect Subtree Size in Binary Tree
- 3313. Find the Last Marked Nodes in Tree
- 3310. Remove Methods From Project
- 329. Longest Increasing Path in a Matrix
- 3249. Count the Number of Good Nodes
- 3241. Time Taken to Mark All Nodes
- 3235. Check if the Rectangle Corner Is Reachable
- 323. Number of Connected Components in an Undirected Graph
- 3203. Find Minimum Diameter After Merging Two Trees
- 3157. Find the Level of Tree with Minimum Sum
- 314. Binary Tree Vertical Order Traversal
- 3123. Find Edges in Shortest Paths
- 310. Minimum Height Trees
- 3067. Count Pairs of Connectable Servers in a Weighted Tree Network
- 302. Smallest Rectangle Enclosing Black Pixels
- 3004. Maximum Subtree of the Same Color
- 298. Binary Tree Longest Consecutive Sequence
- 2973. Find Number of Coins to Place in Tree Nodes
- 297. Serialize and Deserialize Binary Tree
- 2925. Maximum Score After Applying Operations on a Tree
- 2920. Maximum Points After Collecting Coins From All Nodes
- 2872. Maximum Number of K-Divisible Components
- 2867. Count Valid Paths in a Tree
- 2858. Minimum Edge Reversals So Every Node Is Reachable
- 2852. Sum of Remoteness of All Cells
- 285. Inorder Successor in BST
- 2792. Count Nodes That Are Great Enough
- 2791. Count Paths That Can Form a Palindrome in a Tree
- 2773. Height of Special Binary Tree
- 2764. Is Array a Preorder of Some Binary Tree
- 272. Closest Binary Search Tree Value II
- 270. Closest Binary Search Tree Value
- 269. Alien Dictionary
- 2689. Extract Kth Character From The Rope Tree
- 2685. Count the Number of Complete Components
- 2658. Maximum Number of Fish in a Grid
- 2646. Minimize the Total Price of the Trips
- 2641. Cousins in Binary Tree II
- 261. Graph Valid Tree
- 2596. Check Knight Tour Configuration
- 2581. Count Number of Possible Root Nodes
- 257. Binary Tree Paths
- 2556. Disconnect Path in a Binary Matrix by at Most One Flip
- 2538. Difference Between Maximum and Minimum Price Sum
- 250. Count Univalue Subtrees
- 2493. Divide Nodes Into the Maximum Number of Groups
- 2492. Minimum Score of a Path Between Two Cities
- 2479. Maximum XOR of Two Non-Overlapping Subtrees
- 2477. Minimum Fuel Cost to Report to the Capital
- 2476. Closest Nodes Queries in a Binary Search Tree
- 2467. Most Profitable Path in a Tree
- 2458. Height of Binary Tree After Subtree Removal Queries
- 2445. Number of Nodes With Value One
- 2440. Create Components With Same Value
- 2415. Reverse Odd Levels of Binary Tree
- 2385. Amount of Time for Binary Tree to Be Infected
- 2378. Choose Edges to Maximize Score in a Tree
- 2368. Reachable Nodes With Restrictions
- 2360. Longest Cycle in a Graph
- 236. Lowest Common Ancestor of a Binary Tree
- 2359. Find Closest Node to Given Two Nodes
- 235. Lowest Common Ancestor of a Binary Search Tree
- 2331. Evaluate Boolean Binary Tree
- 2328. Number of Increasing Paths in a Grid
- 2322. Minimum Score After Removals on a Tree
- 2316. Count Unreachable Pairs of Nodes in an Undirected Graph
- 2313. Minimum Flips in Binary Tree to Get Result
- 2307. Check for Contradictions in Equations
- 230. Kth Smallest Element in a BST
- 2277. Closest Node to Path in Tree
- 2265. Count Nodes Equal to Average of Subtree
- 226. Invert Binary Tree
- 2246. Longest Path With Different Adjacent Characters
- 2204. Distance to a Cycle in Undirected Graph
- 2192. All Ancestors of a Node in a Directed Acyclic Graph
- 2127. Maximum Employees to Be Invited to a Meeting
- 211. Design Add and Search Words Data Structure
- 2101. Detonate the Maximum Bombs
- 210. Course Schedule II
- 2097. Valid Arrangement of Pairs
- 2096. Step-By-Step Directions From a Binary Tree Node to Another
- 2092. Find All People With Secret
- 207. Course Schedule
- 2049. Count Nodes With the Highest Score
- 2003. Smallest Missing Genetic Value in Each Subtree
- 200. Number of Islands
- 1993. Operations on Tree
- 1992. Find All Groups of Farmland
- 199. Binary Tree Right Side View
- 1973. Count Nodes Equal to Sum of Descendants
- 1971. Find if Path Exists in Graph
- 1970. Last Day Where You Can Still Cross
- 1938. Maximum Genetic Difference Query
- 1932. Merge BSTs to Create Single BST
- 1905. Count Sub Islands
- 1858. Longest Word With All Prefixes
- 1820. Maximum Number of Accepted Invitations
- 1810. Minimum Path Cost in a Hidden Grid
- 1778. Shortest Path in a Hidden Grid
- 1766. Tree of Coprimes
- 1743. Restore the Array From Adjacent Pairs
- 1740. Find Distance in a Binary Tree
- 1722. Minimize Hamming Distance After Swap Operations
- 1676. Lowest Common Ancestor of a Binary Tree IV
- 1666. Change the Root of a Binary Tree
- 1660. Correct a Binary Tree
- 1644. Lowest Common Ancestor of a Binary Tree II
- 1631. Path With Minimum Effort
- 1625. Lexicographically Smallest String After Applying Operations
- 1612. Check If Two Expression Trees are Equivalent
- 1600. Throne Inheritance
- 1568. Minimum Number of Days to Disconnect Island
- 156. Binary Tree Upside Down
- 1559. Detect Cycles in 2D Grid
- 1530. Number of Good Leaf Nodes Pairs
- 1522. Diameter of N-Ary Tree
- 1519. Number of Nodes in the Sub-Tree With the Same Label
- 1516. Move Sub-Tree of N-Ary Tree
- 1506. Find Root of N-Ary Tree
- 1490. Clone N-ary Tree
- 1485. Clone Binary Tree With Random Pointer
- 1483. Kth Ancestor of a Tree Node
- 1469. Find All The Lonely Nodes
- 1466. Reorder Routes to Make All Paths Lead to the City Zero
- 1462. Course Schedule IV
- 1457. Pseudo-Palindromic Paths in a Binary Tree
- 145. Binary Tree Postorder Traversal
- 1448. Count Good Nodes in Binary Tree
- 1443. Minimum Time to Collect All Apples in a Tree
- 144. Binary Tree Preorder Traversal
- 1430. Check If a String Is a Valid Sequence from Root to Leaves Path in a Binary Tree
- 1391. Check if There is a Valid Path in a Grid
- 1382. Balance a Binary Search Tree
- 1379. Find a Corresponding Node of a Binary Tree in a Clone of That Tree
- 1377. Frog Position After T Seconds
- 1376. Time Needed to Inform All Employees
- 1373. Maximum Sum BST in Binary Tree
- 1372. Longest ZigZag Path in a Binary Tree
- 1367. Linked List in Binary Tree
- 1361. Validate Binary Tree Nodes
- 1339. Maximum Product of Splitted Binary Tree
- 133. Clone Graph
- 1325. Delete Leaves With a Given Value
- 1319. Number of Operations to Make Network Connected
- 1315. Sum of Nodes with Even-Valued Grandparent
- 1306. Jump Game III
- 1305. All Elements in Two Binary Search Trees
- 1302. Deepest Leaves Sum
- 130. Surrounded Regions
- 129. Sum Root to Leaf Numbers
- 1273. Delete Tree Nodes
- 1267. Count Servers that Communicate
- 1261. Find Elements in a Contaminated Binary Tree
- 1257. Smallest Common Region
- 1254. Number of Closed Islands
- 1245. Tree Diameter
- 1242. Web Crawler Multithreaded
- 124. Binary Tree Maximum Path Sum
- 1236. Web Crawler
- 1233. Remove Sub-Folders from the Filesystem
- 1214. Two Sum BSTs
- 1203. Sort Items by Groups Respecting Dependencies
- 1202. Smallest String With Swaps
- 1192. Critical Connections in a Network
- 117. Populating Next Right Pointers in Each Node II
- 1161. Maximum Level Sum of a Binary Tree
- 116. Populating Next Right Pointers in Each Node
- 1145. Binary Tree Coloring Game
- 114. Flatten Binary Tree to Linked List
- 113. Path Sum II
- 1123. Lowest Common Ancestor of Deepest Leaves
- 1120. Maximum Average Subtree
- 112. Path Sum
- 1110. Delete Nodes And Return Forest
- 111. Minimum Depth of Binary Tree
- 1102. Path With Maximum Minimum Value
- 110. Balanced Binary Tree
- 1080. Insufficient Nodes in Root to Leaf Paths
- 1042. Flower Planting With No Adjacent
- 104. Maximum Depth of Binary Tree
- 1038. Binary Search Tree to Greater Sum Tree
- 1036. Escape a Large Maze
- 1034. Coloring A Border
- 1028. Recover a Tree From Preorder Traversal
- 1026. Maximum Difference Between Node and Ancestor
- 1022. Sum of Root To Leaf Binary Numbers
- 1020. Number of Enclaves
- 101. Symmetric Tree
- 100. Same Tree