Google Coding Interview Questions: 1309 Tagged Problems
1309 coding problems tagged Google — 192 easy · 741 medium · 376 hard — with solutions in 13 languages. Plus a 4-week study plan by topic.
- Problems: 1309
- By difficulty: 192 easy · 741 medium · 376 hard
- Languages: JavaScript, TypeScript, Python, Java, C++, C, C#, Go, Kotlin, Swift, Rust, PHP and Ruby
- Cost: Free on every plan; sign in to run and submit
1309 problems the CodeKairo catalogue tags as commonly asked in Google's coding rounds — 192 easy, 741 medium and 376 hard — each judged by hidden tests in 13 languages. The most common topics among them are Arrays (785), Dynamic Programming (324) and Strings (320). Tagged for Google and no other company: Sequentially Ordinal Rank Tracker, Finding MK Average and Longest Uploaded Prefix. At 62% of the catalogue the tag is a broad net rather than a shortlist; its placement test pattern is the narrower place to start. CodeKairo's Google — Online Assessment mock covers the Google online assessment pattern for university candidates: two coding problems, one clock, and nothing else. The tag is the catalogue's own annotation of where a problem tends to come up — not a list published by Google, which CodeKairo is not affiliated with.
Google study plan by topic
40 of the 1309 problems tagged Google over 4 weeks, about 22 h 5 min of solving, grouped by technique in the order they build on each other — Strings, Hash Table, Counting and Math and 26 more. It ends with the Google — Online Assessment mock.
Week 1: Strings, Hash Table, Counting +5
12 problems on Strings, Hash Table, Counting, Math, Two Pointers, Sliding Window, Prefix Sum and Sorting, easiest first within each topic.
- Detect Capital Easy
- Jewels and Stones Easy
- Majority Element II Medium
- Minimum Number of Frogs Croaking Medium
- Factorial Trailing Zeroes Medium
- Merge Strings Alternately Easy
- String Compression Medium
- Minimum Difference Between Highest and Lowest of K Scores Easy
- Maximum Number of Vowels in a Substring of Given Length Medium
- Find Pivot Index Easy
- Find the Highest Altitude Easy
- Third Maximum Number Easy
Week 2: Binary Search, Stack, Monotonic Stack +6
12 problems on Binary Search, Stack, Monotonic Stack, Matrix, Simulation, Enumeration, Greedy, Heap and Bit Manipulation, easiest first within each topic.
- Nth Digit Medium
- Reach a Number Medium
- Longest Valid Parentheses Hard
- Number of Visible People in a Queue Hard
- Unique Paths II Medium
- Game of Life Medium
- Number of Arithmetic Triplets Easy
- Largest Perimeter Triangle Easy
- Increasing Triplet Subsequence Medium
- The K Weakest Rows in a Matrix Easy
- Top K Frequent Words Medium
- Counting Bits Easy
Week 3: Bitmask, Number Theory, Combinatorics +8
12 problems on Bitmask, Number Theory, Combinatorics, Trees, Trie, Backtracking, Graph, Breadth-First Search, Topological Sort, Union Find and Shortest Path, easiest first within each topic.
- Maximum AND Sum of Array Hard
- X of a Kind in a Deck of Cards Easy
- Number of Music Playlists Hard
- Time Needed to Inform All Employees Medium
- Longest Path With Different Adjacent Characters Hard
- Maximum XOR of Two Numbers in an Array Medium
- Word Search Medium
- Keys and Rooms Medium
- Pacific Atlantic Water Flow Medium
- Find Eventual Safe States Medium
- Surrounded Regions Medium
- The Maze II Medium
Week 4: Dynamic Programming, Geometry
4 problems on Dynamic Programming and Geometry, easiest first within each topic.
- Best Time to Buy and Sell Stock III Hard
- Distinct Subsequences Hard
- Palindrome Partitioning II Hard
- Projection Area of 3D Shapes Easy
Finally: the timed test
Sit the Google — Online Assessment mock under the clock — the coding problems are only one part of the round.
Google test patterns
- Google — Online Assessment pattern guide and timed mock
The Google interview process, round by round
All problems tagged Google
Easy (192)
- Number of Recent Calls Queue, Design
- Design HashMap Array, Hash Table, Design
- Design HashSet Array, Hash Table, Design
- Range Sum Query - Immutable Array, Prefix Sum, Design
- Count Complete Tree Nodes Binary Search, Bit Manipulation, Tree
- Convert Sorted Array to Binary Search Tree Array, Divide and Conquer, Tree
- Evaluate Boolean Binary Tree Tree, Depth-First Search
- Range Sum of BST Tree, Depth-First Search, Binary Search
- Increasing Order Search Tree Tree, Depth-First Search, Stack
- Leaf-Similar Trees Tree, Depth-First Search
- Subtree of Another Tree Tree, Depth-First Search, String Matching
- Diameter of Binary Tree Tree, Depth-First Search
- Minimum Absolute Difference in BST Tree, Depth-First Search, Breadth-First Search
- Find Mode in Binary Search Tree Tree, Depth-First Search
- Binary Tree Paths Tree, Depth-First Search, Backtracking
- Invert Binary Tree Tree, Depth-First Search, Breadth-First Search
- Balanced Binary Tree Tree, Depth-First Search
- Maximum Depth of Binary Tree Tree, Depth-First Search, Breadth-First Search
- Binary Tree Postorder Traversal Tree, Depth-First Search, Stack
- Binary Tree Preorder Traversal Tree, Depth-First Search, Stack
- Binary Tree Inorder Traversal Tree, Depth-First Search, Stack
- Adjacent Increasing Subarrays Detection I Array
- Longest Strictly Increasing or Strictly Decreasing Subarray Array
- Maximum Area of Longest Diagonal Rectangle Array
- 1-bit and 2-bit Characters Array
- Longest Continuous Increasing Subsequence Array
- Find Most Frequent Vowel and Consonant Hash Table, String, Counting
- Minimum Number of Operations to Make Elements in Array Distinct Array, Hash Table
- Minimum Operations to Make Array Values Equal to K Array, Hash Table
- Most Frequent Number Following Key In an Array Array, Hash Table, Counting
- Shortest Completing Word Array, Hash Table, String
- Substring Matching Pattern String, String Matching
- Valid Word String
- Check if Strings Can be Made Equal With Operations I String
- Check if a String Is an Acronym of Words Array, String
- Determine if Two Events Have Conflict Array, String
- Number of Valid Clock Times String, Enumeration
- Counting Words With a Given Prefix Array, String, String Matching
- Robot Return to Origin String, Simulation
- Longest Uncommon Subsequence I String, Brainteaser
- Delete Columns to Make Sorted Array, String
- Maximize Sum Of Array After K Negations Array, Greedy, Sorting
- Find Nth Root of M Math, Binary Search
- Minimum Positive Sum Subarray Array, Sliding Window, Prefix Sum
- Find X-Sum of All K-Long Subarrays I Array, Hash Table, Sliding Window
- Valid Boomerang Array, Math, Geometry
- Surface Area of 3D Shapes Array, Math, Geometry
- Rectangle Overlap Math, Geometry
- Prime Arrangements Math, Combinatorics
- Find Resultant Array After Removing Anagrams Array, Hash Table, String
- Calculate Digit Sum of a String String, Simulation
- Check Whether Two Strings are Almost Equivalent Hash Table, String, Counting
- Kth Distinct String in an Array Array, Hash Table, String
- Minimum Time to Type Word Using Special Typewriter String, Greedy
- Second Largest Digit in a String Hash Table, String
- Latest Time by Replacing Hidden Digits String, Greedy
- Reformat Phone Number String, Simulation
- Path Crossing Hash Table, String
- Consecutive Characters String, Two Pointers
- Occurrences After Bigram String, Sliding Window
- Positions of Large Groups String, Two Pointers
- Range Addition II Array, Math
- Keep Multiplying Found Values by Two Array, Hash Table, Sorting
- Count Elements With Strictly Smaller and Greater Elements Array, Sorting, Counting
- Minimum Cost of Buying Candies With Discount Array, Greedy, Sorting
- Check if Every Row and Column Contains All Numbers Array, Hash Table, Matrix
- Finding 3-Digit Even Numbers Array, Hash Table, Enumeration
- Find Target Indices After Sorting Array Array, Binary Search, Sorting
- Two Furthest Houses With Different Colors Array, Greedy
- Smallest Index With Equal Value Array, Math
- Two Out of Three Array, Hash Table, Bit Manipulation
- Final Value of Variable After Performing Operations Array, String, Simulation
- Count Special Quadruplets Array, Hash Table, Enumeration
- Remove One Element to Make the Array Strictly Increasing Array, Greedy
- Check if All the Integers in a Range Are Covered Array, Hash Table, Prefix Sum
- Find Nearest Point That Has the Same X or Y Coordinate Array, Geometry
- Check if Array Is Sorted and Rotated Array, Sorting
- Number Of Rectangles That Can Form The Largest Square Array, Counting
- Get Maximum in Generated Array Array, Simulation
- Check Array Formation Through Concatenation Array, Hash Table
- Detect Pattern of Length M Repeated K or More Times Array, Enumeration
- Element Appearing More Than 25% In Sorted Array Array, Binary Search
- Distance Between Bus Stops Array, Prefix Sum
- Valid Mountain Array Array, Two Pointers
- Largest Number At Least Twice of Others Array, Sorting
- Find the Original Typed String I String
- Special Array I Array
- Type of Triangle Array, Math, Sorting
- Find the Losers of the Circular Game Array, Hash Table, Simulation
- Form Smallest Number From Two Digit Arrays Array, Hash Table, Enumeration
- Delete Greatest Value in Each Row Array, Matrix, Sorting
- The Employee That Worked on the Longest Task Array
- Calculate Delayed Arrival Time Math
- Most Frequent Even Element Array, Hash Table, Counting
- Rearrange Characters to Make Target String Hash Table, String, Counting
- Number of Strings That Appear as Substrings in Word Array, String
- Circular Sentence String
- Number of Senior Citizens Array, String
- Find Words Containing Character Array, String
- Strong Password Checker II String
- Decode the Message Hash Table, String
- Count Prefixes of a Given String Array, String
- Count Asterisks String
- Existence of a Substring in a String and Its Reverse String, Hash Table
- Number of Changing Keys String
- Find the Encrypted String String, Simulation
- Count the Number of Incremovable Subarrays I Array, Two Pointers, Enumeration
- Modify the Matrix Array, Matrix
- Find the Power of K-Size Subarrays I Array, Sliding Window
- Number of Bit Changes to Make Two Integers Equal Bit Manipulation
- Find the XOR of Numbers Which Appear Twice Array, Hash Table, Bit Manipulation
- Apple Redistribution into Boxes Array, Greedy, Sorting
- Number of Beautiful Pairs Array, Hash Table, Math
- Check if Array is Good Array, Hash Table, Sorting
- Neither Minimum nor Maximum Array, Sorting
- Alternating Groups I Array, Sliding Window
- Distribute Elements Into Two Arrays I Array, Simulation
- Minimum Sum of Mountain Triplets I Array, Prefix Sum
- Find the Integer Added to Array I Array, Math
- Minimum Operations to Exceed Threshold Value I Array
- Kids With the Greatest Number of Candies Array
- Separate the Digits in an Array Array, Simulation
- Find the Child Who Has the Ball After K Seconds Math, Simulation
- Minimum Time Visiting All Points Array, Math, Geometry
- Split the Array Array, Hash Table, Counting
- Find Champion II Graph
- Find Champion I Array, Matrix, Graph
- Minimum Amount of Time to Fill Cups Array, Greedy, Math
- Kth Missing Positive Number Array, Binary Search
- Minimum Recolors to Get K Consecutive Black Blocks String, Sliding Window
- Valid Word Abbreviation String, Two Pointers
- Rank Transform of an Array Array, Hash Table, Sorting
- Maximum Odd Binary Number String, Greedy
- Distribute Money to Maximum Children Math, Greedy
- Find the Winning Player in Coin Game Math, Game Theory
- Check If It Is a Straight Line Array, Math, Geometry
- Add to Array-Form of Integer Array, Math
- Permutation Difference between Two Strings String, Hash Table
- Remove Palindromic Subsequences String, Two Pointers
- Number of Different Integers in a String String, Hash Table
- Greatest Common Divisor of Strings String, Math
- Verifying an Alien Dictionary Array, String, Hash Table
- Unique Morse Code Words Array, String, Hash Table
- Long Pressed Name String, Two Pointers
- Maximum Difference Between Increasing Elements Array
- Replace Elements with Greatest Element on Right Side Array
- X of a Kind in a Deck of Cards Array, Math, Number Theory
- Fair Candy Swap Array, Hash Table
- Find the Difference Hash Table, String, Bit Manipulation
- Binary Gap Bit Manipulation
- Counting Bits Dynamic Programming, Bit Manipulation
- Number of 1 Bits Divide and Conquer, Bit Manipulation
- Largest Perimeter Triangle Array, Math, Greedy
- Assign Cookies Array, Two Pointers, Greedy
- Projection Area of 3D Shapes Array, Math, Geometry
- The K Weakest Rows in a Matrix Array, Binary Search, Sorting
- Count Negative Numbers in a Sorted Matrix Array, Binary Search, Matrix
- Flipping an Image Array, Two Pointers, Matrix
- Toeplitz Matrix Array, Matrix
- Number of Arithmetic Triplets Array, Hash Table, Two Pointers
- Minimum Common Value Array, Hash Table, Two Pointers
- Count Pairs Whose Sum is Less than Target Array, Two Pointers, Binary Search
- Rearrange Spaces Between Words String
- Special Array With X Elements Greater Than or Equal X Array, Binary Search, Sorting
- Array Partition Array, Greedy, Sorting
- Minimum Difference Between Highest and Lowest of K Scores Array, Sliding Window, Sorting
- Shortest Distance to a Character Array, Two Pointers, String
- Merge Strings Alternately Two Pointers, String
- Count Binary Substrings Two Pointers, String
- Unique Email Addresses Array, Hash Table, String
- Rotate String String, String Matching
- Buddy Strings Hash Table, String
- License Key Formatting String
- Jewels and Stones Hash Table, String
- Longest Palindrome Hash Table, String, Greedy
- Repeated Substring Pattern String, String Matching
- Detect Capital String
- Reverse Vowels of a String Two Pointers, String
- Third Maximum Number Array, Sorting
- Max Consecutive Ones Array
- Sum of All Odd Length Subarrays Array, Math, Prefix Sum
- Find the Highest Altitude Array, Prefix Sum
- How Many Numbers Are Smaller Than the Current Number Array, Hash Table, Counting Sort
- Find Pivot Index Array, Prefix Sum
- Set Mismatch Array, Hash Table, Bit Manipulation
- N-th Tribonacci Number Math, Dynamic Programming, Memoization
- Add Strings Math, String, Simulation
- Plus One Array, Math
- Add Binary Math, String, Bit Manipulation
- Power of Three Math, Recursion
- Power of Two Math, Bit Manipulation
- Happy Number Hash Table, Math, Two Pointers
Medium (741)
- Longest Uploaded Prefix Hash Table, Binary Search, Union Find
- Smallest Number in Infinite Set Hash Table, Heap (Priority Queue), Ordered Set
- Design Bitset Array, Hash Table, String
- Stock Price Fluctuation Hash Table, Design, Heap (Priority Queue)
- Detect Squares Array, Hash Table, Counting
- Design Browser History Array, Linked List, Stack
- Product of the Last K Numbers Array, Math, Prefix Sum
- Iterator for Combination String, Backtracking, Design
- Snapshot Array Array, Hash Table, Binary Search
- Time Based Key-Value Store Hash Table, String, Binary Search
- Online Election Array, Hash Table, Binary Search
- RLE Iterator Array, Counting, Design
- My Calendar II Array, Binary Search, Ordered Set
- My Calendar I Array, Binary Search, Ordered Set
- Design Linked List Linked List, Simulation, Design
- Design Circular Deque Array, Queue, Design
- Design Twitter Hash Table, Heap (Priority Queue), Design
- Map Sum Pairs Hash Table, String, Trie
- Implement Magic Dictionary Hash Table, String, Depth-First Search
- Range Sum Query - Mutable Array, Binary Indexed Tree, Segment Tree
- Range Sum Query 2D - Immutable Array, Matrix, Prefix Sum
- Design Add and Search Words Data Structure String, Depth-First Search, Trie
- Implement Trie (Prefix Tree) Hash Table, String, Trie
- Min Stack Stack, Design
- LRU Cache Hash Table, Design
- Delete Nodes From Linked List Present in Array Array, Hash Table, Linked List
- Double a Number Represented as a Linked List Linked List, Math, Stack
- Insert Greatest Common Divisors in Linked List Linked List, Math, Number Theory
- Merge Nodes in Between Zeros Linked List, Simulation
- Delete the Middle Node of a Linked List Linked List, Two Pointers
- Reverse Nodes in Even Length Groups Linked List, Simulation
- Linked List Components Linked List, Hash Table, Array
- Remove Nth Node From End of List Linked List, Two Pointers
- Add Two Numbers Linked List, Math, Recursion
- K-th Largest Perfect Subtree Size in Binary Tree Tree, Depth-First Search, Sorting
- Reverse Odd Levels of Binary Tree Tree, Depth-First Search, Breadth-First Search
- Amount of Time for Binary Tree to Be Infected Tree, Breadth-First Search, Depth-First Search
- Count Nodes Equal to Average of Subtree Tree, Depth-First Search
- Create Binary Tree From Descriptions Tree, Hash Table, Array
- Step-By-Step Directions From a Binary Tree Node to Another Tree, Depth-First Search, String
- Number of Good Leaf Nodes Pairs Tree, Depth-First Search
- Pseudo-Palindromic Paths in a Binary Tree Tree, Depth-First Search, Bit Manipulation
- Count Good Nodes in Binary Tree Tree, Depth-First Search, Breadth-First Search
- Longest ZigZag Path in a Binary Tree Tree, Depth-First Search, Dynamic Programming
- Linked List in Binary Tree Tree, Depth-First Search
- Maximum Product of Splitted Binary Tree Tree, Depth-First Search
- Delete Leaves With a Given Value Tree, Depth-First Search
- Deepest Leaves Sum Tree, Breadth-First Search, Depth-First Search
- Maximum Level Sum of a Binary Tree Tree, Breadth-First Search
- Binary Tree Coloring Game Tree, Depth-First Search
- Insufficient Nodes in Root to Leaf Paths Tree, Depth-First Search
- Maximum Difference Between Node and Ancestor Tree, Depth-First Search
- Smallest String Starting From Leaf String, Backtracking, Tree
- Distribute Coins in Binary Tree Tree, Depth-First Search
- Flip Equivalent Binary Trees Tree, Depth-First Search
- Smallest Subtree with all the Deepest Nodes Hash Table, Tree, Depth-First Search
- All Nodes Distance K in Binary Tree Hash Table, Tree, Depth-First Search
- Binary Tree Pruning Tree, Depth-First Search
- Insert into a Binary Search Tree Tree, Binary Search
- Longest Univalue Path Tree, Depth-First Search
- Maximum Width of Binary Tree Tree, Depth-First Search, Breadth-First Search
- Add One Row to Tree Tree, Depth-First Search, Breadth-First Search
- Find Bottom Left Tree Value Tree, Depth-First Search, Breadth-First Search
- Most Frequent Subtree Sum Hash Table, Tree, Depth-First Search
- Path Sum III Tree, Depth-First Search, Prefix Sum
- House Robber III Tree, Depth-First Search, Dynamic Programming
- Lowest Common Ancestor of a Binary Tree Tree, Depth-First Search
- Kth Smallest Element in a BST Tree, Depth-First Search
- Sum Root to Leaf Numbers Tree, Depth-First Search
- Path Sum II Tree, Depth-First Search, Backtracking
- Construct Binary Tree from Inorder and Postorder Traversal Tree, Array, Hash Table
- Construct Binary Tree from Preorder and Inorder Traversal Tree, Array, Hash Table
- All Divisions With the Highest Score of a Binary Array Array, Prefix Sum
- Count the Hidden Sequences Array, Prefix Sum
- Intervals Between Identical Elements Array, Hash Table, Prefix Sum
- Find Good Days to Rob the Bank Array, Dynamic Programming, Prefix Sum
- Maximum Number of Non-Overlapping Subarrays With Sum Equals Target Array, Hash Table, Greedy
- Adjacent Increasing Subarrays Detection II Array, Binary Search
- Number of Adjacent Elements With the Same Color Array, Simulation
- Maximize Distance to Closest Person Array, Two Pointers
- Count Special Triplets Array, Hash Table, Counting
- Count Covered Buildings Array, Hash Table, Sorting
- Closest Equal Element Queries Array, Hash Table, Binary Search
- Count Special Subsequences Array, Hash Table, Math
- Identify the Largest Outlier in an Array Array, Hash Table, Counting
- Report Spam Message Array, Hash Table, String
- Minimum Length of Anagram Concatenation Hash Table, String, Counting
- Minimum Number of Operations to Make Word K-Periodic Hash Table, String, Counting
- Find the Length of the Longest Common Prefix Array, Hash Table, String
- Find the Maximum Number of Elements in Subset Array, Hash Table, Enumeration
- Maximum Square Area by Removing Fences From a Field Array, Hash Table, Enumeration
- Count Pairs of Points With Distance k Array, Hash Table, Bit Manipulation
- Check if Strings Can be Made Equal With Operations II Hash Table, String, Sorting
- Minimum Index of a Valid Split Array, Hash Table, Sorting
- Max Sum of a Pair With Equal Sum of Digits Array, Hash Table, Sorting
- Count Artifacts That Can Be Extracted Array, Hash Table, Simulation
- Number of Ways Where Square of Number Is Equal to Product of Two Numbers Array, Hash Table, Math
- Check If Array Pairs Are Divisible by k Array, Hash Table, Counting
- Flip Columns For Maximum Number of Equal Rows Array, Hash Table, Matrix
- Vowel Spellchecker Array, Hash Table, String
- Card Flipping Game Array, Hash Table
- Rabbits in Forest Array, Hash Table, Math
- Maximize Active Section with Trade I String, Enumeration
- Find the Lexicographically Largest String From the Box I Two Pointers, String, Enumeration
- Hash Divided String String, Simulation
- String Compression III String
- Shortest Uncommon Substring in an Array Array, Hash Table, String
- Minimum Time to Revert Word to Initial State I String, Rolling Hash, String Matching
- Find Longest Special Substring That Occurs Thrice I Hash Table, String, Binary Search
- Sum of Beauty of All Substrings Hash Table, String, Counting
- Remove Sub-Folders from the Filesystem Array, String, Depth-First Search
- Binary String With Substrings Representing 1 To N Hash Table, String, Bit Manipulation
- Largest Time for Given Digits Array, String, Enumeration
- Shifting Letters Array, String, Prefix Sum
- Repeated String Match String, String Matching, Rolling Hash
- Longest Uncommon Subsequence II Array, Hash Table, Two Pointers
- Minimum Time for K Connected Components Binary Search, Union Find, Graph
- Minimum Time to Reach Destination in Directed Graph Graph, Heap (Priority Queue), Shortest Path
- Minimum Increments to Equalize Leaf Paths Array, Dynamic Programming, Tree
- Digit Operations to Make Two Integers Equal Math, Graph, Heap (Priority Queue)
- Maximize the Number of Target Nodes After Connecting Trees I Tree, Depth-First Search, Breadth-First Search
- Find Minimum Time to Reach Last Room II Array, Graph, Heap (Priority Queue)
- Find Minimum Time to Reach Last Room I Array, Graph, Heap (Priority Queue)
- Find Subtree Sizes After Changes Array, Hash Table, String
- Find a Safe Walk Through a Grid Array, Breadth-First Search, Graph
- Count the Number of Good Nodes Tree, Depth-First Search
- Shortest Distance After Road Addition Queries I Array, Breadth-First Search, Graph
- Minimum Cost to Convert String I Array, String, Graph
- Minimum Cost of a Path With Special Roads Array, Graph, Heap (Priority Queue)
- Disconnect Path in a Binary Matrix by at Most One Flip Array, Dynamic Programming, Depth-First Search
- K Highest Ranked Items Within a Price Range Array, Breadth-First Search, Sorting
- Minimum Operations to Convert Number Array, Breadth-First Search
- Longest Palindromic Subsequence After at Most K Operations String, Dynamic Programming
- Maximum Frequency After Subarray Operation Array, Hash Table, Dynamic Programming
- Maximum Amount of Money Robot Can Earn Array, Dynamic Programming, Matrix
- Count Paths With the Given XOR Value Array, Dynamic Programming, Bit Manipulation
- Count Beautiful Splits in an Array Array, Dynamic Programming
- Minimum Array Sum Array, Dynamic Programming
- Total Characters in String After Transformations I Hash Table, Math, String
- Find Maximum Removals From Source String Array, Hash Table, Two Pointers
- Maximum Difference Score in a Grid Array, Dynamic Programming, Matrix
- Number of Strings Which Can Be Rearranged to Contain Substring Math, Dynamic Programming, Combinatorics
- Maximum Score After Applying Operations on a Tree Dynamic Programming, Tree, Depth-First Search
- Apply Operations to Make Two Strings Equal String, Dynamic Programming
- First Day Where You Have Been in All the Rooms Array, Dynamic Programming
- Egg Drop With 2 Eggs and N Floors Math, Dynamic Programming
- Best Team With No Conflicts Array, Dynamic Programming, Sorting
- Can I Win Math, Dynamic Programming, Bit Manipulation
- Longest Bitonic Subsequence Array, Dynamic Programming
- Rod Cutting Array, Dynamic Programming
- Lexicographical Numbers Depth-First Search, Trie
- Ambiguous Coordinates String, Backtracking, Enumeration
- Generate Binary Strings Without Adjacent Zeros String, Backtracking, Bit Manipulation
- Construct the Lexicographically Largest Valid Sequence Array, Backtracking
- Splitting a String Into Descending Consecutive Values String, Backtracking, Enumeration
- Combination Sum III Array, Backtracking
- Largest Submatrix With Rearrangements Array, Greedy, Sorting
- Count Unguarded Cells in the Grid Array, Matrix, Simulation
- Largest Magic Square Array, Matrix, Prefix Sum
- Get Biggest Three Rhombus Sums in a Grid Array, Matrix, Prefix Sum
- Minesweeper Array, Breadth-First Search, Depth-First Search
- Largest 1-Bordered Square Array, Dynamic Programming, Matrix
- Image Overlap Array, Matrix, Enumeration
- Maximum Non Negative Product in a Matrix Array, Dynamic Programming, Matrix
- Minimum Operations to Write the Letter Y on a Grid Array, Hash Table, Matrix
- Maximum Sum of an Hourglass Array, Matrix, Prefix Sum
- Diagonal Traverse II Array, Sorting, Matrix
- Lexicographically Smallest Equivalent String String, Union Find
- Minimum Jumps to Reach Home Array, Dynamic Programming, Breadth-First Search
- Count Nodes With the Highest Score Array, Tree, Depth-First Search
- Most Profitable Path in a Tree Array, Tree, Depth-First Search
- All Ancestors of a Node in a Directed Acyclic Graph Graph, Depth-First Search, Breadth-First Search
- The Time When the Network Becomes Idle Array, Graph, Breadth-First Search
- Nearest Exit from Entrance in Maze Array, Matrix, Breadth-First Search
- Minimize Hamming Distance After Swap Operations Array, Union Find, Depth-First Search
- Check if There is a Valid Path in a Grid Matrix, Breadth-First Search, Depth-First Search
- Find the City With the Smallest Number of Neighbors at a Threshold Distance Graph, Shortest Path, Dynamic Programming
- Most Stones Removed with Same Row or Column Graph, Union Find, Depth-First Search
- Visit Array Positions to Maximize Score Array, Dynamic Programming
- Maximum Multiplication Score Array, Dynamic Programming
- Maximum Energy Boost From Two Drinks Array, Dynamic Programming
- Find the Maximum Length of a Good Subsequence I Array, Hash Table, Dynamic Programming
- Find All Possible Stable Binary Arrays I Dynamic Programming, Prefix Sum, Combinatorics
- Maximum Number of Operations With the Same Score II Array, Dynamic Programming, Memoization
- Ways to Split Array Into Good Subarrays Array, Math, Dynamic Programming
- Maximize the Profit as the Salesman Array, Dynamic Programming, Sorting
- Extra Characters in a String String, Hash Table, Dynamic Programming
- Solving Questions With Brainpower Array, Dynamic Programming
- Minimize the Difference Between Target and Chosen Elements Array, Dynamic Programming, Matrix
- Minimum Total Space Wasted With K Resizing Operations Array, Dynamic Programming
- Minimum Sideway Jumps Array, Dynamic Programming, Greedy
- Closest Dessert Cost Array, Dynamic Programming, Backtracking
- Stone Game VI Array, Greedy, Sorting
- Guess Number Higher or Lower II Math, Dynamic Programming, Game Theory
- Filling Bookcase Shelves Array, Dynamic Programming
- Minimum Score Triangulation of Polygon Array, Dynamic Programming
- Length of Longest Fibonacci Subsequence Array, Hash Table, Dynamic Programming
- Binary Trees With Factors Array, Hash Table, Dynamic Programming
- Partition to K Equal Sum Subsets Dynamic Programming, Backtracking, Bitmask
- Out of Boundary Paths Dynamic Programming, Matrix
- Minimize Maximum Pair Sum in Array Array, Two Pointers, Greedy
- Maximum Strength of a Group Array, Greedy, Sorting
- Minimum Cost to Make All Characters Equal String, Greedy, Dynamic Programming
- Minimum Cost to Set Cooking Time Math, Enumeration
- Maximum Number of Weeks for Which You Can Work Array, Greedy
- Delete Columns to Make Sorted II Array, String, Greedy
- Score After Flipping Matrix Array, Greedy, Bit Manipulation
- Broken Calculator Math, Greedy
- Construct the Longest New String Math, Greedy, Brainteaser
- Minimum Cost to Make Array Equalindromic Array, Math, Greedy
- Minimum Increment Operations to Make Array Beautiful Array, Dynamic Programming
- Minimum Number of Groups to Create a Valid Assignment Array, Hash Table, Greedy
- Maximum Matching of Players With Trainers Array, Two Pointers, Greedy
- Maximum Element After Decreasing and Rearranging Array, Greedy, Sorting
- Minimum Number of Coins to be Added Array, Greedy, Sorting
- Two Best Non-Overlapping Events Array, Binary Search, Dynamic Programming
- Divide Intervals Into Minimum Number of Groups Array, Greedy, Sorting
- Describe the Painting Array, Hash Table, Sorting
- Range Sum of Sorted Subarray Sums Array, Two Pointers, Binary Search
- Choose K Elements With Maximum Sum Array, Sorting, Heap (Priority Queue)
- Reward Top K Students Hash Table, String, Sorting
- Mark Elements on Array by Performing Queries Array, Hash Table, Sorting
- Remove Stones to Minimize the Total Array, Greedy, Heap (Priority Queue)
- The Celebrity Problem Array, Stack, Two Pointers
- Jump Game VI Array, Dynamic Programming, Queue
- Check if a Parentheses String Can Be Valid String, Stack, Greedy
- Beautiful Towers II Array, Stack, Monotonic Stack
- Find the Most Competitive Subsequence Array, Stack, Greedy
- Largest Number After Mutating Substring Array, String, Greedy
- Count Submatrices With All Ones Array, Stack, Matrix
- Maximum Subarray Min-Product Array, Stack, Monotonic Stack
- Steps to Make Array Non-decreasing Array, Stack, Monotonic Stack
- K-th Element of Two Sorted Arrays Array, Binary Search, Divide and Conquer
- Minimum Absolute Difference Between Elements With Constraint Array, Binary Search, Ordered Set
- Minimum Sum of Squared Difference Array, Binary Search, Greedy
- Earliest Second to Mark Indices I Array, Binary Search, Greedy
- Median in a Row-Wise Sorted Matrix Array, Binary Search, Matrix
- Minimum Number of Seconds to Make Mountain Height Zero Array, Math, Binary Search
- Maximum Number of Alloys Array, Binary Search
- Minimum Operations to Make All Array Elements Equal Array, Binary Search, Sorting
- Minimum Absolute Sum Difference Array, Binary Search, Sorting
- Count Number of Rectangles Containing Each Point Array, Hash Table, Binary Search
- Maximum Tastiness of Candy Basket Array, Binary Search, Greedy
- Minimized Maximum of Products Distributed to Any Store Array, Binary Search, Greedy
- Minimum Absolute Difference Queries Array, Hash Table, Binary Search
- Maximum Side Length of a Square with Sum Less than or Equal to Threshold Array, Binary Search, Matrix
- Sum of Mutated Array Closest to Target Array, Binary Search, Sorting
- Heaters Array, Binary Search, Sorting
- Number of Smooth Descent Periods of a Stock Array, Math, Dynamic Programming
- Count Substrings With K-Frequency Characters I Hash Table, String, Sliding Window
- Count of Substrings Containing Every Vowel and K Consonants I Hash Table, String, Sliding Window
- Count Substrings That Can Be Rearranged to Contain a String I Hash Table, String, Sliding Window
- Shortest Subarray With OR at Least K II Array, Bit Manipulation, Sliding Window
- Maximize Win From Two Segments Array, Binary Search, Sliding Window
- Maximum White Tiles Covered by a Carpet Array, Sliding Window, Sorting
- K Divisible Elements Subarrays Array, Hash Table, Trie
- Count the Number of Fair Pairs Array, Two Pointers, Binary Search
- Count of Interesting Subarrays Array, Hash Table, Prefix Sum
- Maximum Sum of Almost Unique Subarray Array, Hash Table, Sliding Window
- Count Subarrays Where Max Element Appears at Least K Times Array, Sliding Window
- Continuous Subarrays Array, Sliding Window, Monotonic Queue
- Shortest Subarray to be Removed to Make Array Sorted Array, Two Pointers, Binary Search
- Minimum Moves to Make Array Complementary Array, Hash Table, Prefix Sum
- Ways to Split Array Into Three Subarrays Array, Two Pointers, Binary Search
- Longest Continuous Subarray With Absolute Diff Less Than or Equal to Limit Array, Sliding Window, Monotonic Queue
- Fair Distribution of Cookies Dynamic Programming, Backtracking, Bit Manipulation
- Maximum Compatibility Score Sum Dynamic Programming, Backtracking, Bit Manipulation
- Special Permutations Array, Dynamic Programming, Bit Manipulation
- Beautiful Arrangement Dynamic Programming, Backtracking, Bit Manipulation
- Substring XOR Queries Array, Hash Table, String
- Maximum Possible Number by Binary Concatenation Array, Bit Manipulation, Enumeration
- Maximum Rows Covered by Columns Array, Bit Manipulation, Matrix
- Maximum Xor Product Math, Greedy, Bit Manipulation
- Smallest Subarrays With Maximum Bitwise OR Array, Binary Search, Bit Manipulation
- Prime Pairs With Target Sum Array, Math, Enumeration
- Minimum Operations to Make the Integer Zero Bit Manipulation, Brainteaser, Enumeration
- Punishment Number of an Integer Math, Backtracking
- Minimize the Maximum of Two Arrays Math, Binary Search, Number Theory
- Count Collisions of Monkeys on a Polygon Math, Recursion
- Closest Prime Numbers in Range Math, Number Theory
- Sum of Number and Its Reverse Math, Enumeration
- Minimum Non-Zero Product of the Array Elements Math, Greedy, Recursion
- Count Good Numbers Math, Recursion
- Queries on Number of Points Inside a Circle Array, Math, Geometry
- Circle and Rectangle Overlapping Math, Geometry
- Valid Square Math, Geometry
- Rectangle Area Math, Geometry
- Maximum Number of Consecutive Values You Can Make Array, Greedy, Sorting
- Number of Sets of K Non-Overlapping Line Segments Math, Dynamic Programming, Combinatorics
- Simplified Fractions Math, String, Number Theory
- Four Divisors Array, Math, Number Theory
- Ugly Number III Math, Binary Search, Number Theory
- Robot Bounded In Circle Math, String, Simulation
- Smallest Integer Divisible by K Hash Table, Math, Number Theory
- Smallest Range II Array, Math, Greedy
- Water and Jug Problem Math, Depth-First Search, Breadth-First Search
- Bulb Switcher II Math, Bit Manipulation, Breadth-First Search
- Different Ways to Add Parentheses Math, String, Recursion
- Fraction to Recurring Decimal Hash Table, Math, String
- Lexicographically Smallest String After Substring Operation String, Greedy
- Find the Longest Semi-Repetitive Substring String, Sliding Window
- Find the Substring With Maximum Cost Array, Hash Table, String
- Find the Divisibility Array of a String Array, Math, String
- Make Number of Distinct Characters Equal Hash Table, String, Counting
- Append Characters to String to Make Subsequence Two Pointers, String, Greedy
- Minimum Penalty for a Shop String, Prefix Sum
- Using a Robot to Print the Lexicographically Smallest String Hash Table, String, Stack
- Length of the Longest Alphabetical Continuous Substring String, Sliding Window
- Minimum Amount of Time to Collect Garbage Array, String, Prefix Sum
- Largest Palindromic Number Hash Table, String, Greedy
- Shifting Letters II Array, String, Prefix Sum
- Time Needed to Rearrange a Binary String String, Dynamic Programming, Simulation
- Construct Smallest Number From DI String String, Stack, Greedy
- Maximize Number of Subsequences in a String String, Greedy, Prefix Sum
- Longest Palindrome by Concatenating Two Letter Words Array, Hash Table, String
- Decode the Slanted Ciphertext String, Simulation
- Vowels of All Substrings Math, String, Dynamic Programming
- Plates Between Candles Array, String, Binary Search
- Remove Colored Pieces if Both Neighbors are the Same Color Math, String, Greedy
- Number of Pairs of Strings With Concatenation Equal to Target Array, Hash Table, String
- Largest Merge Of Two Strings Two Pointers, String, Greedy
- Change Minimum Characters to Satisfy One of Three Conditions Hash Table, String, Counting
- Maximum Binary String After Change String, Greedy
- Split a String Into the Max Number of Unique Substrings Hash Table, String, Backtracking
- Find Kth Bit in Nth Binary String String, Recursion, Simulation
- Minimum Suffix Flips String, Greedy
- Number of Substrings With Only 1s Math, String
- Check If a String Contains All Binary Codes of Size K Hash Table, String, Bit Manipulation
- Compare Strings by Frequency of the Smallest Character Array, Hash Table, String
- Letter Tile Possibilities Hash Table, String, Backtracking
- Find And Replace in String Array, Hash Table, String
- Subdomain Visit Count Array, Hash Table, String
- Expressive Words Array, Two Pointers, String
- Minimum Time Difference Array, Math, String
- Optimal Division Array, Math, Dynamic Programming
- Additive Number String, Backtracking, Enumeration
- Bulls and Cows Hash Table, String, Counting
- Repeated DNA Sequences Hash Table, String, Sliding Window
- Rotated Digits Math, Dynamic Programming
- Sum of Distances Array, Hash Table, Prefix Sum
- Find the Prefix Common Array of Two Arrays Array, Hash Table, Bit Manipulation
- Find Score of an Array After Marking All Elements Array, Hash Table, Sorting
- Maximize Greatness of an Array Array, Two Pointers, Greedy
- Count the Number of Beautiful Subarrays Array, Hash Table, Bit Manipulation
- Rearrange Array to Maximize Prefix Score Array, Greedy, Sorting
- Longest Square Streak in an Array Array, Hash Table, Binary Search
- Divide Players Into Teams of Equal Skill Array, Hash Table, Two Pointers
- Maximum Sum of Distinct Subarrays With Length K Array, Hash Table, Sliding Window
- Number of Subarrays With LCM Equal to K Array, Math, Number Theory
- Number of Subarrays With GCD Equal to K Array, Math, Number Theory
- Minimize Maximum of Array Array, Binary Search, Greedy
- Find All Good Indices Array, Dynamic Programming, Prefix Sum
- Node With Highest Edge Score Hash Table, Graph
- Check if There is a Valid Partition For The Array Array, Dynamic Programming
- Task Scheduler II Array, Hash Table, Simulation
- Maximum Number of Groups Entering a Competition Array, Math, Binary Search
- Replace Elements in an Array Array, Hash Table, Simulation
- Minimum Lines to Represent a Line Chart Array, Math, Geometry
- Maximum Bags With Full Capacity of Rocks Array, Greedy, Sorting
- Minimum Rounds to Complete All Tasks Array, Hash Table, Greedy
- Find All Lonely Numbers in the Array Array, Hash Table, Counting
- Minimum Operations to Make a Uni-Value Grid Array, Math, Sorting
- Grid Game Array, Matrix, Prefix Sum
- Maximum Alternating Subsequence Sum Array, Dynamic Programming
- Reduction Operations to Make the Array Elements Equal Array, Sorting
- Maximum Absolute Sum of Any Subarray Array, Dynamic Programming, Prefix Sum
- Tuple with Same Product Array, Hash Table, Counting
- Count Good Meals Array, Hash Table
- Sum of Absolute Differences in a Sorted Array Array, Math, Prefix Sum
- Ways to Make a Fair Array Array, Prefix Sum
- Make Sum Divisible by P Array, Hash Table, Prefix Sum
- Maximum Subarray Sum with One Deletion Array, Dynamic Programming
- Number of Burgers with No Waste of Ingredients Math
- Decrease Elements To Make Array Zigzag Array, Greedy
- Maximum Sum of Two Non-Overlapping Subarrays Array, Dynamic Programming, Sliding Window
- Minimum Domino Rotations For Equal Row Array, Greedy
- Array of Doubled Pairs Array, Hash Table, Greedy
- Global and Local Inversions Array, Math
- Make Three Strings Equal String
- Minimum Number of Increments on Subarrays to Form a Target Array Array, Greedy, Dynamic Programming
- Find the Winner of an Array Game Array, Simulation
- Queries on a Permutation With Key Array, Binary Indexed Tree, Simulation
- Corporate Flight Bookings Array, Prefix Sum
- Find the Winner of the Circular Game Array, Math, Recursion
- Longest Subsequence With Limited Sum Array, Binary Search, Greedy
- Partition Array for Maximum Sum Array, Dynamic Programming
- Stone Game VII Array, Math, Dynamic Programming
- Minimum Number of Work Sessions to Finish the Tasks Array, Dynamic Programming, Bit Manipulation
- Count Fertile Pyramids in a Land Array, Dynamic Programming, Matrix
- Number of Ways to Divide a Long Corridor Math, String, Dynamic Programming
- Maximum Number of Non-overlapping Palindrome Substrings String, Dynamic Programming, Greedy
- Count Ways to Group Overlapping Ranges Array, Sorting, Math
- Count Number of Ways to Place Houses Math, Dynamic Programming
- Count Number of Texts Hash Table, Math, String
- Number of Ways to Reach a Position After Exactly k Steps Math, Dynamic Programming, Combinatorics
- Delete Characters to Make Fancy String String, Greedy
- Count Number of Homogenous Substrings Math, String
- Construct String With Repeat Limit Hash Table, String, Greedy
- Minimum Number of Steps to Make Two Strings Anagram II Hash Table, String, Counting
- Count Vowel Substrings of a String Hash Table, String, Sliding Window
- Longest Substring of All Vowels in Order String, Sliding Window
- Minimum Deletions to Make String Balanced String, Dynamic Programming, Stack
- Minimum Length of String After Operations Hash Table, String, Counting
- Minimum Number of Changes to Make Binary String Beautiful String, Greedy
- Lexicographically Minimum String After Removing Stars String, Greedy, Heap (Priority Queue)
- Count Substrings Starting and Ending with Given Character Math, String, Counting
- Sort Vowels in a String String, Sorting
- Find the Integer Added to Array II Array, Two Pointers, Sorting
- Minimum Operations to Exceed Threshold Value II Array, Heap (Priority Queue), Simulation
- Sum of Digit Differences of All Pairs Array, Hash Table, Math
- Alternating Groups II Array, Sliding Window
- Minimum Sum of Mountain Triplets II Array, Prefix Sum
- Count Days Without Meetings Array, Sorting
- Water Bottles II Math, Simulation
- Determine the Minimum Sum of a k-avoiding Array Array, Math, Greedy
- Find the Value of the Partition Array, Sorting
- Maximum Value of an Ordered Triplet II Array, Prefix Sum
- Process Tasks Using Servers Array, Simulation, Heap (Priority Queue)
- Maximum Number of Eaten Apples Array, Greedy, Heap (Priority Queue)
- K-th Smallest Prime Fraction Array, Binary Search, Sorting
- Find K Pairs with Smallest Sums Array, Heap (Priority Queue)
- Maximum Subsequence Score Array, Greedy, Sorting
- Total Cost to Hire K Workers Array, Two Pointers, Simulation
- Single-Threaded CPU Array, Sorting, Heap (Priority Queue)
- Most Beautiful Item for Each Query Array, Binary Search, Sorting
- Number of Orders in the Backlog Array, Simulation, Heap (Priority Queue)
- Maximum Number of Events That Can Be Attended Array, Greedy, Sorting
- The Number of the Smallest Unoccupied Chair Array, Hash Table, Heap (Priority Queue)
- Maximal Score After Applying K Operations Array, Greedy, Heap (Priority Queue)
- Find the Kth Largest Integer in the Array Array, String, Sorting
- Maximum Score From Removing Stones Math, Greedy, Heap (Priority Queue)
- Minimum Cost to Connect Sticks Array, Greedy, Heap (Priority Queue)
- Find the Safest Path in a Grid Array, Matrix, Binary Search
- Number of Ways to Arrive at Destination Graph, Dynamic Programming, Shortest Path
- Course Schedule IV Graph, Topological Sort, Depth-First Search
- Parallel Courses Graph, Topological Sort, Breadth-First Search
- Detonate the Maximum Bombs Array, Math, Graph
- The Maze II Array, Matrix, Graph
- Open the Lock Array, String, Breadth-First Search
- Loud and Rich Array, Graph, Topological Sort
- Shortest Path with Alternating Colors Graph, Breadth-First Search
- Number of Nodes in the Sub-Tree With the Same Label Hash Table, Tree, Graph
- Minimum Fuel Cost to Report to the Capital Tree, Graph, Depth-First Search
- Maximum Star Sum of a Graph Array, Graph, Greedy
- Count the Number of Complete Components Graph, Union Find, Depth-First Search
- Minimum Score of a Path Between Two Cities Graph, Union Find, Depth-First Search
- Reachable Nodes With Restrictions Array, Tree, Graph
- Largest Plus Sign Array, Matrix, Dynamic Programming
- Remove All Ones With Row and Column Flips Array, Matrix, Bit Manipulation
- Number of Corner Rectangles Array, Matrix, Math
- Magic Squares In Grid Array, Matrix, Simulation
- Construct Product Matrix Array, Matrix, Prefix Sum
- Maximum Number of Moves in a Grid Array, Matrix, Dynamic Programming
- Map of Highest Peak Array, Matrix, Breadth-First Search
- Check Knight Tour Configuration Array, Matrix, Depth-First Search
- First Completely Painted Row or Column Array, Matrix, Hash Table
- Find All Groups of Farmland Array, Matrix, Depth-First Search
- Matrix Block Sum Array, Matrix, Prefix Sum
- Spiral Matrix III Array, Matrix, Simulation
- Where Will the Ball Fall Array, Matrix, Simulation
- Maximum Matrix Sum Array, Matrix, Greedy
- Minimum Cost Tree From Leaf Values Array, Dynamic Programming, Stack
- The Number of Beautiful Subsets Array, Hash Table, Dynamic Programming
- Longest Binary Subsequence Less Than or Equal to K String, Greedy, Dynamic Programming
- Number of Ways to Select Buildings String, Dynamic Programming, Prefix Sum
- Number of People Aware of a Secret Queue, Dynamic Programming, Simulation
- Longest Ideal Subsequence Hash Table, String, Dynamic Programming
- Stone Game II Array, Dynamic Programming, Prefix Sum
- Predict the Winner Array, Dynamic Programming, Recursion
- Count Ways To Build Good Strings Dynamic Programming
- Longest Arithmetic Subsequence Array, Hash Table, Dynamic Programming
- Coin Change II Array, Dynamic Programming
- Minimum Impossible OR Array, Bit Manipulation, Brainteaser
- Minimum Additions to Make Valid String String, Greedy, Dynamic Programming
- Partition String Into Substrings With Values at Most K String, Greedy, Dynamic Programming
- Stone Game IX Array, Math, Greedy
- Minimum Operations to Make Median of Array Equal to K Array, Greedy, Sorting
- Destroy Sequential Targets Array, Hash Table, Counting
- Smallest Missing Non-negative Integer After Operations Array, Hash Table, Math
- Separate Black and White Balls String, Greedy, Two Pointers
- Find the Maximum Number of Marked Indices Array, Two Pointers, Greedy
- Maximum Split of Positive Even Integers Math, Greedy
- Count Collisions on a Road String, Stack, Simulation
- Video Stitching Array, Greedy, Dynamic Programming
- Eliminate Maximum Number of Monsters Array, Greedy, Sorting
- Minimum Number of Operations to Move All Balls to Each Box Array, String, Prefix Sum
- Minimum Number of Arrows to Burst Balloons Array, Greedy, Sorting
- Maximum Number of Removable Characters Array, String, Binary Search
- Divide Chocolate Array, Binary Search, Greedy
- Successful Pairs of Spells and Potions Array, Binary Search, Sorting
- Search a 2D Matrix II Array, Matrix, Binary Search
- Find Right Interval Array, Binary Search, Sorting
- House Robber IV Array, Binary Search, Greedy
- Minimize the Maximum Difference of Pairs Array, Binary Search, Greedy
- Maximum Candies Allocated to K Children Array, Binary Search
- H-Index II Array, Binary Search
- Find the Smallest Divisor Given a Threshold Array, Binary Search
- Maximum Value at a Given Index in a Bounded Array Binary Search, Greedy, Math
- Find the Student That Will Replace the Chalk Array, Binary Search, Prefix Sum
- Minimum Limit of Balls in a Bag Array, Binary Search
- Magnetic Force Between Two Balls Array, Binary Search, Sorting
- Minimum Number of Days to Make m Bouquets Array, Binary Search
- Capacity to Ship Packages Within D Days Array, Binary Search
- Find Minimum in Rotated Sorted Array II Array, Binary Search
- Search in Rotated Sorted Array II Array, Binary Search
- Minimum Swaps to Group All 1's Together II Array, Sliding Window
- Length of Longest Subarray With at Most K Frequency Array, Hash Table, Sliding Window
- Maximum Beauty of an Array After Applying Operation Array, Sliding Window, Sorting
- Number of Subarrays with Bounded Maximum Array, Sliding Window, Two Pointers
- Count the Number of Good Subarrays Array, Hash Table, Sliding Window
- Swap For Longest Repeated Character Substring String, Sliding Window, Hash Table
- Replace the Substring for Balanced String String, Sliding Window, Two Pointers
- Get Equal Substrings Within Budget String, Sliding Window, Binary Search
- Maximize the Confusion of an Exam String, Sliding Window, Prefix Sum
- Frequency of the Most Frequent Element Array, Sliding Window, Greedy
- Maximum Points You Can Obtain from Cards Array, Sliding Window, Prefix Sum
- Grumpy Bookstore Owner Array, Sliding Window
- Number of Substrings Containing All Three Characters String, Hash Table, Sliding Window
- Longest Substring with At Most K Distinct Characters String, Hash Table, Sliding Window
- Longest Substring with At Most Two Distinct Characters String, Hash Table, Sliding Window
- Watering Plants II Array, Two Pointers, Simulation
- Number of Subsequences That Satisfy the Given Sum Condition Array, Two Pointers, Sorting
- 3Sum With Multiplicity Array, Hash Table, Two Pointers
- Most Profit Assigning Work Array, Two Pointers, Greedy
- Push Dominoes String, Two Pointers, Dynamic Programming
- Longest Mountain in Array Array, Two Pointers, Dynamic Programming
- Partition Array Such That Maximum Difference Is K Array, Greedy, Sorting
- Sort Transformed Array Array, Two Pointers, Math
- Bag of Tokens Array, Two Pointers, Greedy
- Max Number of K-Sum Pairs Array, Two Pointers, Hash Table
- 4Sum Array, Two Pointers, Sorting
- Maximum Distance Between a Pair of Values Array, Two Pointers, Binary Search
- Sum of Square Numbers Math, Two Pointers, Binary Search
- Maximum OR Bit Manipulation, Array, Greedy
- Minimum Array End Bit Manipulation, Greedy
- Number of Wonderful Substrings Bit Manipulation, Hash Table, String
- Bitwise ORs of Subarrays Bit Manipulation, Array, Dynamic Programming
- Find the Longest Substring Containing Vowels in Even Counts Bit Manipulation, Hash Table, String
- Longest Nice Subarray Bit Manipulation, Array, Sliding Window
- UTF-8 Validation Bit Manipulation, Array
- Maximum XOR for Each Query Bit Manipulation, Array, Prefix Sum
- Count Number of Maximum Bitwise-OR Subsets Bit Manipulation, Backtracking, Enumeration
- XOR Queries of a Subarray Bit Manipulation, Array, Prefix Sum
- Decode XORed Permutation Bit Manipulation, Array, Brainteaser
- Minimize XOR Bit Manipulation, Greedy
- Flip String to Monotone Increasing String, Dynamic Programming, Bit Manipulation
- Find the Xor-Beauty of Array Bit Manipulation, Array, Math
- Maximum XOR After Operations Bit Manipulation, Array, Brainteaser
- Longest Subarray With Maximum Bitwise AND Bit Manipulation, Array, Brainteaser
- Minimum Number of Operations to Make Array XOR Equal to K Bit Manipulation, Array
- Find The Original Array of Prefix Xor Bit Manipulation, Array, Prefix Sum
- Bitwise XOR of All Pairings Bit Manipulation, Array, Brainteaser
- Minimum Time to Repair Cars Array, Binary Search, Greedy
- Maximum Value of an Ordered Triplet I Array, Math, Prefix Sum
- Super Ugly Number Dynamic Programming, Math, Heap
- Minimum Moves to Reach Target Score Math, Greedy
- Integer Replacement Bit Manipulation, Greedy, Dynamic Programming
- Reordered Power of 2 Math, Counting, Enumeration
- Minimum Operations to Reduce an Integer to 0 Bit Manipulation, Greedy, Dynamic Programming
- Maximum Product After K Increments Array, Greedy, Heap
- Prime Subtraction Operation Array, Math, Greedy
- Minimum Number of Operations to Make Array Empty Hash Table, Greedy, Counting
- Number of Zero-Filled Subarrays Array, Math, Counting
- 4Sum II Hash Table, Array, Counting
- Find Players With Zero or One Losses Hash Table, Array, Sorting
- Minimum Area Rectangle Hash Table, Array, Geometry
- Number of Boomerangs Hash Table, Math, Array
- Group the People Given the Group Size They Belong To Hash Table, Array, Greedy
- Optimal Partition of String Hash Table, String, Greedy
- Count Number of Bad Pairs Hash Table, Array, Counting
- Determine if Two Strings Are Close Hash Table, String, Counting
- Brick Wall Hash Table, Array, Counting
- Smallest String With Swaps Union Find, Hash Table, String
- Number of Pairs of Interchangeable Rectangles Array, Hash Table, Math
- Count Nice Pairs in an Array Array, Hash Table, Math
- Longest Well-Performing Interval Array, Hash Table, Prefix Sum
- Subarray Sums Divisible by K Array, Hash Table, Prefix Sum
- Maximum Number of Integers to Choose From a Range I Hash Table, Greedy, Binary Search
- Short Encoding of Words String, Trie, Hash Table
- Replace Words String, Trie, Hash Table
- Longest Word in Dictionary String, Trie, Hash Table
- Word Subsets String, Hash Table, Counting
- Number of Good Ways to Split a String String, Hash Table, Prefix Sum
- Can Convert String in K Moves String, Hash Table, Greedy
- Longest Substring With At Least K Repeating Characters String, Sliding Window, Divide and Conquer
- Maximum Number of Occurrences of a Substring String, Sliding Window, Hash Table
- Number of Ways to Split a String String, Math, Counting
- Minimum Number of Frogs Croaking String, Greedy, Counting
- Count Substrings That Differ by One Character String, Dynamic Programming
- Maximum Length of a Concatenated String With Unique Characters String, Bit Manipulation, Backtracking
- Count Words Obtained After Adding a Letter String, Bit Manipulation, Hash Table
- Longest Word in Dictionary Through Deleting String, Two Pointers, Sorting
- Number of Matching Subsequences String, Two Pointers, Binary Search
- Find and Replace Pattern String, Hash Table
- Count Number of Teams Array, Dynamic Programming
- Uncrossed Lines Array, Dynamic Programming
- Minimum ASCII Delete Sum for Two Strings String, Dynamic Programming
- Unique Binary Search Trees Dynamic Programming, Math
- Domino and Tromino Tiling Dynamic Programming
- Paint Fence Dynamic Programming
- Reach a Number Math, Binary Search
- Check if Number is a Sum of Powers of Three Math, Number Theory
- Number of Steps to Reduce a Number in Binary Representation to One String, Bit Manipulation, Simulation
- Find Original Array From Doubled Array Array, Greedy, Sorting
- Non-decreasing Array Array, Greedy
- Minimum Moves to Equal Array Elements II Array, Math, Sorting
- Word Search Array, String, Backtracking
- Pacific Atlantic Water Flow Array, Depth-First Search, Breadth-First Search
- Snakes and Ladders Array, Breadth-First Search, Matrix
- Minimum Genetic Mutation Hash Table, String, Breadth-First Search
- Jump Game III Array, Depth-First Search, Breadth-First Search
- Count Unreachable Pairs of Nodes in an Undirected Graph Depth-First Search, Breadth-First Search, Union Find
- Maximum Total Importance of Roads Graph, Greedy, Sorting
- Find Closest Node to Given Two Nodes Depth-First Search, Graph
- Maximal Network Rank Graph
- Path With Minimum Effort Array, Binary Search, Depth-First Search
- Time Needed to Inform All Employees Tree, Depth-First Search, Breadth-First Search
- Reorder Routes to Make All Paths Lead to the City Zero Depth-First Search, Breadth-First Search, Graph
- Possible Bipartition Depth-First Search, Breadth-First Search, Union Find
- Minimum Height Trees Depth-First Search, Breadth-First Search, Graph
- Detect Cycles in 2D Grid Array, Depth-First Search, Breadth-First Search
- Number of Distinct Islands Array, Hash Table, Depth-First Search
- Shortest Bridge Array, Depth-First Search, Breadth-First Search
- The Earliest Moment When Everyone Become Friends Array, Union Find, Sorting
- Number of Operations to Make Network Connected Depth-First Search, Breadth-First Search, Union Find
- Count Sub Islands Array, Depth-First Search, Breadth-First Search
- As Far from Land as Possible Array, Dynamic Programming, Breadth-First Search
- Shortest Path in Binary Matrix Array, Breadth-First Search, Matrix
- Number of Enclaves Array, Depth-First Search, Breadth-First Search
- Minimum Number of Vertices to Reach All Nodes Graph
- Find Eventual Safe States Depth-First Search, Breadth-First Search, Graph
- All Paths From Source to Target Backtracking, Depth-First Search, Breadth-First Search
- Keys and Rooms Depth-First Search, Breadth-First Search, Graph
- Is Graph Bipartite? Depth-First Search, Breadth-First Search, Union Find
- Graph Valid Tree Depth-First Search, Breadth-First Search, Union Find
- Number of Connected Components in an Undirected Graph Depth-First Search, Breadth-First Search, Union Find
- Rotate Function Array, Math, Dynamic Programming
- Nth Digit Math, Binary Search
- Bulb Switcher Math, Brainteaser
- Count Triplets That Can Form Two Arrays of Equal XOR Array, Hash Table, Math
- Concatenation of Consecutive Binary Numbers Math, Bit Manipulation, Simulation
- Maximum Product of Word Lengths Array, String, Bit Manipulation
- Sort Integers by The Power Value Dynamic Programming, Memoization, Sorting
- Minimum Flips to Make a OR b Equal to c Bit Manipulation
- Gray Code Math, Backtracking, Bit Manipulation
- Maximum XOR of Two Numbers in an Array Array, Hash Table, Bit Manipulation
- Bitwise AND of Numbers Range Bit Manipulation
- Total Hamming Distance Array, Math, Bit Manipulation
- Single Number III Array, Bit Manipulation
- Single Number II Array, Bit Manipulation
- Minimum Insertions to Balance a Parentheses String String, Stack, Greedy
- Remove All Adjacent Duplicates in String II String, Stack
- The Number of Weak Characters in the Game Array, Greedy, Sorting
- Maximum Score From Removing Substrings String, Stack, Greedy
- Minimum Number of Swaps to Make the String Balanced String, Stack, Greedy
- Max Chunks To Make Sorted Array, Stack, Greedy
- Sum of Subarray Ranges Array, Stack, Monotonic Stack
- Reveal Cards In Increasing Order Array, Queue, Sorting
- Reverse Substrings Between Each Pair of Parentheses String, Stack
- Basic Calculator II Math, String, Stack
- Validate Stack Sequences Array, Stack, Simulation
- Next Greater Element III Math, Two Pointers, String
- Maximum Width Ramp Array, Stack, Monotonic Stack
- 132 Pattern Array, Binary Search, Stack
- Sum of Subarray Minimums Array, Dynamic Programming, Stack
- Check If Word Is Valid After Substitutions String, Stack
- Score of Parentheses String, Stack
- Minimum Remove to Make Valid Parentheses String, Stack
- Minimum Add to Make Parentheses Valid String, Stack, Greedy
- Find K Closest Elements Array, Two Pointers, Binary Search
- Kth Smallest Element in a Sorted Matrix Array, Binary Search, Sorting
- Top K Frequent Words Array, Hash Table, String
- K Closest Points to Origin Array, Math, Divide and Conquer
- Partition Array into Disjoint Intervals Array, Greedy
- Remove Duplicate Letters String, Stack, Greedy
- Monotone Increasing Digits Math, Greedy
- Maximum Swap Math, Greedy
- Valid Triangle Number Array, Two Pointers, Binary Search
- Remove Covered Intervals Array, Greedy, Sorting
- Minimum Deletions to Make Character Frequencies Unique String, Hash Table, Greedy
- Queue Reconstruction by Height Array, Greedy, Sorting
- Two City Scheduling Array, Greedy, Sorting
- Knight Dialer Dynamic Programming
- 2 Keys Keyboard Math, Dynamic Programming
- Maximum Length of Pair Chain Array, Dynamic Programming, Greedy
- Longest Turbulent Subarray Array, Dynamic Programming, Sliding Window
- Number of Dice Rolls With Target Sum Dynamic Programming
- Best Sightseeing Pair Array, Dynamic Programming
- Maximum Sum Circular Subarray Array, Divide and Conquer, Dynamic Programming
- Minimum Cost For Tickets Array, Dynamic Programming
- Longest String Chain Array, Hash Table, Two Pointers
- Combination Sum IV Array, Dynamic Programming
- Ones and Zeroes Array, String, Dynamic Programming
- Last Stone Weight II Array, Dynamic Programming
- Stone Game Array, Math, Dynamic Programming
- Count Numbers with Unique Digits Math, Dynamic Programming, Backtracking
- Integer Break Math, Dynamic Programming
- Perfect Squares Math, Dynamic Programming, Breadth-First Search
- Triangle Array, Dynamic Programming
- Minimum Falling Path Sum Array, Dynamic Programming, Matrix
- Interleaving String String, Dynamic Programming
- Delete Operation for Two Strings String, Dynamic Programming
- Wiggle Subsequence Array, Dynamic Programming, Greedy
- Number of Longest Increasing Subsequence Array, Dynamic Programming, Binary Indexed Tree
- Longest Arithmetic Subsequence of Given Difference Array, Hash Table, Dynamic Programming
- Maximum Length of Repeated Subarray Array, Binary Search, Dynamic Programming
- Best Time to Buy and Sell Stock with Transaction Fee Array, Dynamic Programming, Greedy
- Best Time to Buy and Sell Stock with Cooldown Array, Dynamic Programming
- Delete and Earn Array, Hash Table, Dynamic Programming
- Valid Sudoku Array, Hash Table, Matrix
- Number of Closed Islands Array, Depth-First Search, Breadth-First Search
- Surrounded Regions Array, Depth-First Search, Breadth-First Search
- Game of Life Array, Matrix, Simulation
- Count Square Submatrices with All Ones Array, Dynamic Programming, Matrix
- Maximal Square Array, Dynamic Programming, Matrix
- Unique Paths II Array, Dynamic Programming, Matrix
- Minimum Path Sum Array, Dynamic Programming, Matrix
- Sort the Matrix Diagonally Array, Sorting, Matrix
- Max Increase to Keep City Skyline Array, Greedy, Matrix
- Diagonal Traverse Array, Matrix, Simulation
- Count Number of Nice Subarrays Array, Hash Table, Math
- Binary Subarrays With Sum Array, Hash Table, Sliding Window
- Maximum Erasure Value Array, Hash Table, Sliding Window
- Minimum Operations to Reduce X to Zero Array, Hash Table, Binary Search
- Longest Subarray of 1's After Deleting One Element Array, Dynamic Programming, Sliding Window
- Continuous Subarray Sum Array, Hash Table, Math
- Contiguous Array Array, Hash Table, Prefix Sum
- Subarray Product Less Than K Array, Sliding Window, Binary Search
- Number of Sub-arrays of Size K and Average Greater than or Equal to Threshold Array, Sliding Window
- Maximum Number of Vowels in a Substring of Given Length String, Sliding Window
- Valid Parenthesis String String, Dynamic Programming, Stack
- String Compression Two Pointers, String
- Count and Say String, Simulation
- Majority Element II Array, Hash Table, Sorting
- Increasing Triplet Subsequence Array, Greedy
- H-Index Array, Sorting, Counting Sort
- Shortest Unsorted Continuous Subarray Array, Two Pointers, Sorting
- Next Permutation Array, Two Pointers
- Find All Duplicates in an Array Array, Hash Table
- Factorial Trailing Zeroes Math
- Count Primes Math, Sieve of Eratosthenes
Hard (376)
- Sequentially Ordinal Rank Tracker Design, Heap (Priority Queue), Ordered Set
- Finding MK Average Queue, Heap (Priority Queue), Ordered Set
- Design Skiplist Linked List, Design
- Prefix and Suffix Search Array, Hash Table, String
- Range Module Segment Tree, Ordered Set, Design
- LFU Cache Hash Table, Linked List, Design
- Data Stream as Disjoint Intervals Binary Search, Design, Ordered Set
- Reverse Nodes in k-Group Linked List, Recursion
- Merge k Sorted Lists Linked List, Divide and Conquer, Heap (Priority Queue)
- Height of Binary Tree After Subtree Removal Queries Tree, Depth-First Search, Breadth-First Search
- Maximum Sum BST in Binary Tree Tree, Depth-First Search, Dynamic Programming
- Recover a Tree From Preorder Traversal Tree, Depth-First Search, String
- Vertical Order Traversal of a Binary Tree Tree, Depth-First Search, Breadth-First Search
- Binary Tree Cameras Tree, Depth-First Search, Dynamic Programming
- Binary Tree Maximum Path Sum Tree, Depth-First Search, Dynamic Programming
- Stamping the Grid Array, Greedy, Matrix
- Maximum Number of Ways to Partition an Array Array, Hash Table, Counting
- Smallest Rotation with Highest Score Array, Prefix Sum
- Sum of Imbalance Numbers of All Subarrays Array, Hash Table, Ordered Set
- Minimum Time to Revert Word to Initial State II String, Rolling Hash, String Matching
- Maximum Product of the Length of Two Palindromic Substrings String, Rolling Hash, Hash Table
- Longest Chunked Palindrome Decomposition Two Pointers, String, Dynamic Programming
- GCD Sort of an Array Array, Math, Union Find
- Rank Transform of a Matrix Array, Union Find, Graph
- Last Day Where You Can Still Cross Array, Binary Search, Depth-First Search
- Bricks Falling When Hit Array, Union Find, Matrix
- Maximize the Number of Target Nodes After Connecting Trees II Tree, Depth-First Search, Breadth-First Search
- Shortest Distance After Road Addition Queries II Array, Graph, Ordered Set
- Time Taken to Mark All Nodes Tree, Depth-First Search, Graph
- Number of Possible Sets of Closing Branches Bit Manipulation, Graph, Heap (Priority Queue)
- Count Visited Nodes in a Directed Graph Dynamic Programming, Graph, Memoization
- Maximum Number of K-Divisible Components Tree, Depth-First Search
- Count Valid Paths in a Tree Math, Dynamic Programming, Tree
- Minimum Edge Reversals So Every Node Is Reachable Dynamic Programming, Depth-First Search, Breadth-First Search
- Minimum Edge Weight Equilibrium Queries in a Tree Array, Tree, Graph
- Minimize the Total Price of the Trips Array, Dynamic Programming, Tree
- Minimum Number of Visited Cells in a Grid Array, Dynamic Programming, Stack
- Minimum Reverse Operations Array, Breadth-First Search, Ordered Set
- Collect Coins in a Tree Array, Tree, Graph
- Add Edges to Make Degrees of All Nodes Even Hash Table, Graph
- Create Components With Same Value Array, Math, Tree
- Minimum Score After Removals on a Tree Array, Bit Manipulation, Tree
- Maximum Score of a Node Sequence Array, Graph, Sorting
- Minimum Weighted Subgraph With the Required Paths Graph, Shortest Path, Heap (Priority Queue)
- Strange Printer II Array, Graph, Topological Sort
- Minimum Number of Flips to Convert Binary Matrix to Zero Matrix Array, Hash Table, Bit Manipulation
- Minimum Moves to Move a Box to Their Target Location Array, Breadth-First Search, Heap (Priority Queue)
- Escape a Large Maze Array, Hash Table, Depth-First Search
- Minimize Malware Spread II Array, Hash Table, Depth-First Search
- Cat and Mouse Graph, Topological Sort, Memoization
- Reachable Nodes In Subdivided Graph Graph, Heap (Priority Queue), Shortest Path
- K-Similar Strings String, Breadth-First Search
- Contain Virus Array, Depth-First Search, Breadth-First Search
- Cut Off Trees for Golf Event Array, Breadth-First Search, Heap (Priority Queue)
- Length of Longest V-Shaped Diagonal Segment Array, Dynamic Programming, Memoization
- Find the Number of Subsequences With Equal GCD Array, Math, Dynamic Programming
- Find the Original Typed String II String, Dynamic Programming, Prefix Sum
- Find the Maximum Sequence Value of Array Array, Dynamic Programming, Bit Manipulation
- Select Cells in Grid With Maximum Score Array, Dynamic Programming, Bit Manipulation
- Find the Count of Monotonic Pairs I Array, Math, Dynamic Programming
- Find the Maximum Length of a Good Subsequence II Array, Hash Table, Dynamic Programming
- Minimum Sum of Values by Dividing Array Array, Binary Search, Dynamic Programming
- Find the Sum of Subsequence Powers Array, Dynamic Programming, Sorting
- Find the Sum of the Power of All Subsequences Array, Dynamic Programming
- Maximize Consecutive Elements in an Array After Modification Array, Dynamic Programming, Sorting
- Maximize the Number of Partitions After Operations String, Dynamic Programming, Bit Manipulation
- Count the Number of Powerful Integers Math, String, Dynamic Programming
- Find Maximum Non-decreasing Array Length Array, Binary Search, Dynamic Programming
- Maximum Points After Collecting Coins From All Nodes Array, Dynamic Programming, Bit Manipulation
- Count of Sub-Multisets With Bounded Sum Array, Hash Table, Dynamic Programming
- Number of Beautiful Integers in the Range Math, Dynamic Programming, Digit DP
- Count of Integers Math, String, Dynamic Programming
- Maximum Strictly Increasing Cells in a Matrix Array, Hash Table, Binary Search
- Minimum Total Distance Traveled Array, Dynamic Programming, Sorting
- Maximum Deletions on a String String, Dynamic Programming, Rolling Hash
- Check if There Is a Valid Parentheses String Path Array, Dynamic Programming, Matrix
- The Earliest and Latest Rounds Where Players Compete Dynamic Programming, Memoization
- Maximum Number of Groups Getting Fresh Donuts Array, Dynamic Programming, Bit Manipulation
- Make the XOR of All Segments Equal to Zero Array, Dynamic Programming, Bit Manipulation
- Minimum Number of Removals to Make Mountain Array Array, Binary Search, Dynamic Programming
- Minimum Cost to Connect Two Groups of Points Array, Dynamic Programming, Bit Manipulation
- K Inverse Pairs Array Dynamic Programming, Prefix Sum
- Non-negative Integers without Consecutive Ones Dynamic Programming, Digit DP, Bit Manipulation
- Freedom Trail String, Dynamic Programming, Depth-First Search
- Matrix Chain Multiplication Array, Dynamic Programming
- Zuma Game String, Dynamic Programming, Breadth-First Search
- Remove Boxes Array, Dynamic Programming, Memoization
- Number of Squareful Arrays Array, Math, Backtracking
- Closest Subsequence Sum Array, Two Pointers, Bitmask
- Maximum Number of Achievable Transfer Requests Array, Backtracking, Bit Manipulation
- Stickers to Spell Word String, Dynamic Programming, Backtracking
- Tiling a Rectangle with the Fewest Squares Backtracking, Recursion
- 24 Game Array, Math, Backtracking
- Verbal Arithmetic Puzzle Array, Math, String
- Distribute Repeating Integers Array, Backtracking, Bitmask
- Expression Add Operators Math, String, Backtracking
- N-Queens II Backtracking, Bit Manipulation
- Word Search II String, Backtracking, Trie
- Sudoku Solver Array, Hash Table, Backtracking
- Minimum Cost to Make at Least One Valid Path in a Grid Breadth-First Search, Graph, Matrix
- Shortest Path in a Grid with Obstacles Elimination Array, Breadth-First Search, Matrix
- Transform to Chessboard Array, Math, Bit Manipulation
- Minimum Moves to Reach Target with Rotations Array, Breadth-First Search, Matrix
- Number of Paths with Max Score Array, Dynamic Programming, Matrix
- Max Sum of Rectangle No Larger Than K Array, Binary Search, Matrix
- Remove Max Number of Edges to Keep Graph Fully Traversable Graph, Union Find, Greedy
- Find Critical and Pseudo-Critical Edges in Minimum Spanning Tree Graph, Union Find, Minimum Spanning Tree
- Shortest Path to Get All Keys Array, Bit Manipulation, Breadth-First Search
- Minimize Malware Spread Array, Hash Table, Graph
- Similar String Groups Array, Hash Table, String
- Sum of Distances in Tree Tree, Depth-First Search, Graph
- Shortest Cycle in a Graph Graph, Breadth-First Search
- Divide Nodes Into the Maximum Number of Groups Graph, Breadth-First Search, Union Find
- Longest Path With Different Adjacent Characters Array, String, Tree
- Maximum Employees to Be Invited to a Meeting Graph, Topological Sort, Depth-First Search
- Second Minimum Time to Reach Destination Graph, Breadth-First Search, Shortest Path
- Parallel Courses III Array, Graph, Topological Sort
- Largest Color Value in a Directed Graph Graph, Topological Sort, Dynamic Programming
- Redundant Connection II Graph, Union Find, Depth-First Search
- Palindrome Partitioning III String, Dynamic Programming
- Number of Beautiful Partitions String, Dynamic Programming, Prefix Sum
- Selling Pieces of Wood Array, Dynamic Programming, Memoization
- Minimum Time to Remove All Cars Containing Illegal Goods String, Dynamic Programming, Prefix Sum
- Minimum Operations to Make the Array K-Increasing Array, Binary Search, Dynamic Programming
- Number of Unique Good Subsequences String, Dynamic Programming
- Count Number of Special Subsequences Array, Dynamic Programming
- Minimum Skips to Arrive at Meeting On Time Array, Dynamic Programming
- Maximize Palindrome Length From Subsequences String, Dynamic Programming
- Number of Ways to Form a Target String Given a Dictionary Array, String, Dynamic Programming
- Count All Possible Routes Array, Dynamic Programming, Memoization
- Minimum Number of Days to Eat N Oranges Dynamic Programming, Memoization
- Paint House III Array, Dynamic Programming
- Number of Ways of Cutting a Pizza Array, Dynamic Programming, Matrix
- Pizza With 3n Slices Array, Dynamic Programming, Greedy
- Jump Game V Array, Dynamic Programming, Sorting
- Minimum Distance to Type a Word Using Two Fingers String, Dynamic Programming
- Maximum Profit in Job Scheduling Array, Binary Search, Dynamic Programming
- Dice Roll Simulation Array, Dynamic Programming
- Stone Game V Array, Math, Dynamic Programming
- Minimum Cost to Merge Stones Array, Dynamic Programming, Prefix Sum
- Super Egg Drop Math, Binary Search, Dynamic Programming
- Maximum Sum of 3 Non-Overlapping Subarrays Array, Dynamic Programming, Prefix Sum
- Arithmetic Slices II - Subsequence Array, Dynamic Programming, Hash Table
- Decode Ways II String, Dynamic Programming
- Minimum Swaps To Make Sequences Increasing Array, Dynamic Programming
- Maximum Score from Performing Multiplication Operations Array, Dynamic Programming
- Maximum Score Of Spliced Array Array, Dynamic Programming
- Minimum Operations to Form Subsequence With Target Sum Array, Greedy, Bit Manipulation
- Rearranging Fruits Array, Hash Table, Greedy
- Partition Array Into Two Arrays to Minimize Sum Difference Array, Binary Search, Bit Manipulation
- Minimum Initial Energy to Finish Tasks Array, Greedy, Sorting
- Delete Columns to Make Sorted III Array, String, Dynamic Programming
- Orderly Queue Math, String, Sorting
- Couples Holding Hands Greedy, Union Find, Graph
- Create Maximum Number Array, Greedy, Stack
- Patching Array Array, Greedy
- Minimum Deletions to Make Array Divisible Array, Math, Sorting
- Minimum Time to Finish the Race Array, Dynamic Programming
- Set Intersection Size At Least Two Array, Greedy, Sorting
- My Calendar III Binary Search, Segment Tree, Prefix Sum
- Kth Smallest Instructions Array, Math, Dynamic Programming
- Minimum Amount of Damage Dealt to Bob Array, Greedy, Sorting
- Maximum Spending After Buying Items Array, Greedy, Sorting
- Earliest Possible Day of Full Bloom Array, Greedy, Sorting
- Minimum Difference in Sums After Removal of Elements Array, Dynamic Programming, Heap (Priority Queue)
- Maximum Number of Points From Grid Queries Array, Breadth-First Search, Matrix
- Course Schedule III Array, Greedy, Sorting
- Minimum Interval to Include Each Query Array, Binary Search, Sorting
- The Skyline Problem Array, Divide and Conquer, Heap (Priority Queue)
- Brace Expansion II String, Stack, Backtracking
- Number of Atoms Hash Table, String, Stack
- Basic Calculator Math, String, Stack
- Find the Number of Subarrays Where Boundary Elements Are Maximum Array, Binary Search, Stack
- Robot Collisions Array, Stack, Sorting
- Max Chunks To Make Sorted II Array, Stack, Greedy
- Replace Non-Coprime Numbers in Array Array, Math, Stack
- Sum of Total Strength of Wizards Array, Stack, Monotonic Stack
- Maximum Score of a Good Subarray Array, Two Pointers, Stack
- Next Greater Element IV Array, Stack, Monotonic Stack
- Maximum Sum Queries Array, Binary Search, Sorting
- Minimum Operations to Make a Subsequence Array, Hash Table, Binary Search
- Find Building Where Alice and Bob Can Meet Array, Binary Search, Monotonic Stack
- Longest Increasing Subsequence II Array, Dynamic Programming, Segment Tree
- Minimum Cost to Make Array Equal Array, Binary Search, Greedy
- Maximize the Minimum Powered City Array, Binary Search, Greedy
- Number of Flowers in Full Bloom Array, Binary Search, Sorting
- Kth Smallest Product of Two Sorted Arrays Array, Binary Search, Two Pointers
- Apply Operations to Maximize Frequency Score Array, Sliding Window, Sorting
- Maximum Fruits Harvested After at Most K Steps Array, Binary Search, Sliding Window
- Count Subarrays With Score Less Than K Array, Binary Search, Sliding Window
- Count Subarrays With Median K Array, Hash Table, Prefix Sum
- Maximize Score After N Operations Math, Dynamic Programming, Number Theory
- Parallel Courses II Dynamic Programming, Bit Manipulation, Graph
- Number of Ways to Wear Different Hats to Each Other Array, Dynamic Programming, Bit Manipulation
- Maximum Students Taking Exam Dynamic Programming, Bit Manipulation, Matrix
- Minimum XOR Sum of Two Arrays Array, Dynamic Programming, Bit Manipulation
- Number of Subarrays With AND Value of K Array, Binary Search, Bit Manipulation
- Apply Operations on Array to Maximize Sum of Squares Array, Hash Table, Greedy
- Count Prefix and Suffix Pairs II Array, String, Trie
- Maximum Strong Pair XOR II Array, Bit Manipulation, Trie
- Number of Excellent Pairs Array, Hash Table, Binary Search
- Maximum Score Words Formed by Letters Array, String, Backtracking
- Maximum XOR With an Element From Array Array, Bit Manipulation, Trie
- Count Pairs With XOR in a Range Array, Bit Manipulation, Trie
- Find XOR Sum of All Pairs Bitwise AND Array, Math, Bit Manipulation
- Check if Point Is Reachable Math, Number Theory
- Sum of Floored Pairs Array, Math, Binary Search
- Largest Palindrome Product Math, Enumeration
- Self Crossing Array, Math, Geometry
- Erect the Fence Array, Math, Geometry
- Perfect Rectangle Array, Hash Table, Math
- Rectangle Area II Array, Math, Geometry
- Numbers With Repeated Digits Math, Dynamic Programming, Digit DP
- Numbers At Most N Given Digit Set Math, Dynamic Programming, Digit DP
- Consecutive Numbers Sum Math, Enumeration
- Reaching Points Math, Number Theory
- Poor Pigs Math, Dynamic Programming, Combinatorics
- Palindrome Partitioning IV String, Dynamic Programming
- Word Break II Hash Table, String, Dynamic Programming
- Palindrome Pairs Array, Hash Table, String
- Concatenated Words String, Dynamic Programming, Depth-First Search
- Distinct Echo Substrings String, Trie, Rolling Hash
- Find the String with LCP String, Dynamic Programming, Greedy
- Count Complete Substrings Hash Table, String, Sliding Window
- Length of the Longest Valid Substring Array, Hash Table, String
- Lexicographically Smallest Beautiful String String, Greedy
- Subsequence With the Minimum Score String, Two Pointers, Binary Search
- Count Palindromic Subsequences String, Dynamic Programming, Counting
- Sum of Prefix Scores of Strings Array, String, Trie
- Naming a Company Hash Table, String, Bit Manipulation
- Total Appeal of A String String, Hash Table, Dynamic Programming
- Sum of Scores of Built Strings String, String Matching, Rolling Hash
- Parsing A Boolean Expression String, Stack, Recursion
- Last Substring in Lexicographical Order String, Two Pointers
- Student Attendance Record II Dynamic Programming, Combinatorics
- Remove Invalid Parentheses String, Backtracking, Breadth-First Search
- Text Justification Array, String, Simulation
- Count Ways to Make Array With Product Array, Math, Dynamic Programming
- Count the Number of Ideal Arrays Math, Dynamic Programming, Combinatorics
- Number of Ways to Rearrange Sticks With K Sticks Visible Math, Dynamic Programming, Combinatorics
- The Number of Good Subsets Array, Math, Dynamic Programming
- Number of Ways to Reorder Array to Get Same BST Array, Math, Divide and Conquer
- Make Array Strictly Increasing Array, Binary Search, Dynamic Programming
- Odd Even Jump Array, Dynamic Programming, Stack
- Maximum Number of Events That Can Be Attended II Array, Binary Search, Dynamic Programming
- Minimum Replacements to Sort the Array Array, Math, Greedy
- Create Sorted Array Through Instructions Array, Binary Search, Divide and Conquer
- Painting the Walls Array, Dynamic Programming
- Reverse Pairs Array, Binary Search, Divide and Conquer
- Number of Ways to Separate Numbers String, Dynamic Programming, Suffix Array
- Painting a Grid With Three Different Colors Dynamic Programming, Bitmask
- Minimum Incompatibility Array, Dynamic Programming, Bit Manipulation
- Number of Distinct Roll Sequences Dynamic Programming, Memoization
- Form Largest Integer With Digits That Add up to Target Array, String, Dynamic Programming
- Build Array Where You Can Find The Maximum Exactly K Comparisons Dynamic Programming, Prefix Sum
- Stone Game VIII Array, Math, Dynamic Programming
- Allocate Mailboxes Array, Math, Dynamic Programming
- Constrained Subsequence Sum Array, Dynamic Programming, Queue
- Restore the Array String, Dynamic Programming
- Count All Valid Pickup and Delivery Options Math, Dynamic Programming, Combinatorics
- Maximum Height by Stacking Cuboids Array, Dynamic Programming, Sorting
- Cherry Pickup II Array, Dynamic Programming, Matrix
- Strange Printer String, Dynamic Programming
- Number of Ways to Stay in the Same Place After Some Steps Dynamic Programming
- Maximum Value of K Coins From Piles Array, Dynamic Programming, Prefix Sum
- Count Special Integers Math, Dynamic Programming, Combinatorics
- Number of Great Partitions Array, Dynamic Programming
- Minimum Cost to Split an Array Array, Hash Table, Dynamic Programming
- Paths in Matrix Whose Sum Is Divisible by K Array, Dynamic Programming, Matrix
- Special Binary String String, Recursion, Divide and Conquer
- Count Different Palindromic Subsequences String, Dynamic Programming
- Smallest K-Length Subsequence With Occurrences of a Letter String, Stack, Greedy
- Valid Palindrome III String, Dynamic Programming
- Count Anagrams Hash Table, Math, String
- String Compression II String, Dynamic Programming
- Apply Operations to Maximize Score Array, Math, Stack
- Meeting Rooms III Array, Sorting, Simulation
- Smallest Range Covering Elements from K Lists Array, Hash Table, Greedy
- Minimize Deviation in Array Array, Greedy, Heap (Priority Queue)
- Maximum Performance of a Team Array, Greedy, Sorting
- Construct Target Array With Multiple Sums Array, Heap (Priority Queue), Math
- Minimum Number of Operations to Make Array Continuous Array, Hash Table, Binary Search
- Put Marbles in Bags Array, Greedy, Sorting
- Minimum Time to Visit a Cell In a Grid Array, Matrix, Graph
- Minimum Number of Days to Disconnect Island Array, Matrix, Depth-First Search
- Number of Increasing Paths in a Grid Array, Matrix, Dynamic Programming
- Checking Existence of Edge Length Limited Paths Array, Union Find, Graph
- Find All People With Secret Graph, Union Find, Depth-First Search
- Minimum Obstacle Removal to Reach Corner Array, Matrix, Graph
- Number of Good Paths Array, Tree, Graph
- Largest Component Size by Common Factor Array, Math, Union Find
- Critical Connections in a Network Graph, Depth-First Search, Biconnected Component
- Bus Routes Array, Hash Table, Breadth-First Search
- Number of Restricted Paths From First to Last Node Graph, Dynamic Programming, Shortest Path
- Sliding Puzzle Array, Matrix, Breadth-First Search
- Jump Game IV Array, Hash Table, Breadth-First Search
- Trapping Rain Water II Array, Matrix, Heap (Priority Queue)
- Escape the Spreading Fire Array, Matrix, Binary Search
- Grid Illumination Array, Hash Table, Matrix
- Shortest Distance from All Buildings Array, Matrix, Breadth-First Search
- Minimum Moves to Spread Stones Over Grid Array, Matrix, Dynamic Programming
- Making A Large Island Array, Matrix, Depth-First Search
- Unique Paths III Array, Matrix, Backtracking
- Number of Submatrices That Sum to Target Array, Matrix, Hash Table
- Longest Increasing Path in a Matrix Array, Matrix, Dynamic Programming
- Maximal Rectangle Array, Matrix, Stack
- Minimum Difficulty of a Job Schedule Array, Dynamic Programming
- Minimum Cost to Cut a Stick Array, Dynamic Programming, Sorting
- Minimum White Tiles After Covering With Carpets String, Dynamic Programming, Prefix Sum
- Maximum Number of Groups With Increasing Length Array, Greedy, Sorting
- Number of Ways to Earn Points Array, Dynamic Programming
- Scramble String String, Dynamic Programming
- Number of Music Playlists Math, Dynamic Programming, Combinatorics
- Profitable Schemes Array, Dynamic Programming
- Distinct Subsequences II String, Dynamic Programming
- Cherry Pickup Array, Matrix, Dynamic Programming
- Number of Ways to Paint N × 3 Grid Dynamic Programming
- Tallest Billboard Array, Dynamic Programming
- Best Time to Buy and Sell Stock IV Array, Dynamic Programming
- Burst Balloons Array, Dynamic Programming
- Frog Jump Array, Hash Table, Dynamic Programming
- Minimum Falling Path Sum II Array, Matrix, Dynamic Programming
- Dungeon Game Array, Matrix, Dynamic Programming
- Minimum Time to Complete All Tasks Array, Greedy, Sorting
- Minimum Number of Refueling Stops Array, Greedy, Dynamic Programming
- IPO Array, Greedy, Sorting
- Minimum Number of Taps to Open to Water a Garden Array, Greedy, Dynamic Programming
- Maximum Number of Tasks You Can Assign Array, Binary Search, Greedy
- Find the Kth Smallest Sum of a Matrix With Sorted Rows Array, Matrix, Binary Search
- Russian Doll Envelopes Array, Binary Search, Dynamic Programming
- Maximum Running Time of N Computers Array, Binary Search, Greedy
- Minimum Time to Complete Trips Array, Binary Search
- Kth Smallest Number in Multiplication Table Math, Binary Search
- Split Array Largest Sum Array, Binary Search, Greedy
- Minimum Number of Flips to Make the Binary String Alternating String, Sliding Window, Dynamic Programming
- Take K of Each Character From Left and Right String, Hash Table, Sliding Window
- Minimum Number of K Consecutive Bit Flips Array, Sliding Window, Prefix Sum
- Shortest Subarray with Sum at Least K Array, Prefix Sum, Sliding Window
- Count Subarrays With Fixed Bounds Array, Sliding Window, Two Pointers
- Maximum Number of Robots Within Budget Array, Sliding Window, Two Pointers
- Minimum Window Subsequence String, Two Pointers, Dynamic Programming
- Minimum Number of Moves to Make Palindrome String, Two Pointers, Greedy
- Find K-th Smallest Pair Distance Array, Two Pointers, Binary Search
- Subarrays with K Different Integers Array, Hash Table, Sliding Window
- Shortest Path Visiting All Nodes Bit Manipulation, Breadth-First Search, Graph
- Count the Number of Square-Free Subsets Bit Manipulation, Dynamic Programming, Bitmask
- Maximum AND Sum of Array Bit Manipulation, Dynamic Programming, Bitmask
- Find Subarray With Bitwise OR Closest to K Bit Manipulation, Array, Binary Search
- Minimum One Bit Operations to Make Integers Zero Bit Manipulation, Math, Dynamic Programming
- Smallest Good Base Math, Binary Search, Number Theory
- Number of Digit One Math, Digit DP, Recursion
- Preimage Size of Factorial Zeroes Function Math, Binary Search, Number Theory
- Nth Magical Number Math, Binary Search, Number Theory
- Largest Multiple of Three Array, Greedy, Dynamic Programming
- Count of Range Sum Fenwick Tree, Divide and Conquer, Prefix Sum
- Substring with Concatenation of All Words Hash Table, String, Sliding Window
- Max Points on a Line Hash Table, Math, Geometry
- Longest Happy Prefix String, KMP, Rolling Hash
- Count Unique Characters of All Substrings of a Given String String, Hash Table, Counting
- Shortest Palindrome String, KMP, Rolling Hash
- Max Value of Equation Array, Monotonic Queue, Sliding Window
- Count of Smaller Numbers After Self Array, Fenwick Tree, Divide and Conquer
- Stone Game IV Math, Dynamic Programming, Game Theory
- Stone Game III Array, Dynamic Programming, Game Theory
- Palindrome Partitioning II String, Dynamic Programming
- Wildcard Matching String, Dynamic Programming, Greedy
- Distinct Subsequences String, Dynamic Programming
- Max Dot Product Between Two Subsequences Array, Dynamic Programming
- Minimum Insertion Steps to Make a String Palindrome String, Dynamic Programming
- Swim in Rising Water Array, Binary Search, Depth-First Search
- Word Ladder Hash Table, String, Breadth-First Search
- Longest Cycle in a Graph Depth-First Search, Graph, Topological Sort
- Number of Visible People in a Queue Array, Stack, Monotonic Stack
- Longest Valid Parentheses String, Dynamic Programming, Stack
- Count Vowels Permutation Dynamic Programming
- Best Time to Buy and Sell Stock III Array, Dynamic Programming
Topics Google asks most
- Arrays 785 problems
- Dynamic Programming 324 problems
- Strings 320 problems
- Hash Table 268 problems
- Math 206 problems
- Greedy 190 problems
- Sorting 182 problems
- Binary Search 148 problems
- Depth-First Search 135 problems
- Matrix 134 problems
- Breadth-First Search 110 problems
- Prefix Sum 109 problems