Practice these problems to strengthen your understanding of data structures and algorithms. Filter by difficulty, category, or search for specific problems.
Practice these problems to strengthen your understanding of data structures and algorithms.
Showing 61 of 61 problems
Determine if a string reads the same forward and backward.
Determine if one string is a scrambled version of another string.
Reverse a string to create a simple encryption system.
Check if two strings are anagrams of each other.
Find the longest common prefix among a set of strings.
Compress a string by replacing repeated characters with counts.
Implement a pattern matching algorithm for filtering emails.
Calculate the factorial of a number using recursion.
Generate the Fibonacci sequence using recursion.
Implement a binary search algorithm to find a book's position in a sorted catalog.
Solve the Tower of Hanoi puzzle using recursion.
Implement a flood fill algorithm for a digital art application's paint bucket tool.
Generate all possible permutations of a set.
Find if there exists a subset of elements that sum to a target value.
Find the largest rectangle containing only 1's in a binary matrix.
Implement a regular expression matcher with support for '.' and '*' patterns.
Count ways to paint an m×n grid with three colors such that no adjacent cells have the same color.
Find the length of the longest valid parentheses substring.
Count the number of special subsequences in a binary array.
Calculate how much rainwater can be trapped between buildings of varying heights.
Implement a wildcard pattern matcher with support for '?' and '*' patterns.
Form the largest integer with digits that add up to a target sum.
Find the largest plus sign of 1's in a grid of 0's and 1's.
Find the length of the longest palindromic subsequence in a string.
Find the longest palindromic substring in a string.
Find the maximum sum of a subarray with at most one element deletion.
Find the length of the longest Fibonacci subsequence in an array.
Make an array strictly increasing by replacing elements.
Count the number of ways to climb a staircase taking 1 or 2 steps at a time.
Find the maximum amount of money you can rob without alerting the police.
Rob houses arranged in a circle without alerting the police.
Count the number of unique paths from top-left to bottom-right of a grid.
Count unique paths in a grid with obstacles.
Find the path with the minimum sum from top-left to bottom-right in a grid.
Find the number of ways to assign + and - to reach a target sum.
Determine if an array can be partitioned into two equal sum subsets.
Find the maximum number of strings that can be formed with given limits of 0s and 1s.
Find the length of the longest turbulent subarray.
Find the minimum number of insertions needed to make a string palindromic.
Count the number of strings of length n that consist only of vowels and follow specific rules.
Count the number of distinct sequences that can be obtained with dice rolls.
Count the number of ways to tile a 2 x n board with dominos and trominos.
Find the maximum profit from buying and selling a stock once.
Find the maximum profit from buying and selling stocks with at most two transactions.
Find the maximum profit from buying and selling stocks with at most k transactions.
Find the maximum profit with a cooldown period after selling.
Find the maximum profit with a transaction fee for each trade.
Find the maximum score of a team with no age-score conflicts.
Count the number of distinct phone numbers of length n that a chess knight can dial.
Calculate the probability that a knight remains on the board after k moves.
Count the number of paths to move a ball out of a grid boundary.
Find the minimum number of operations to get n 'A's using copy and paste.
Collect maximum cherries in a grid by making two passes.
Collect maximum cherries with two robots moving simultaneously.
Count the number of possible combinations that add up to a target.
Count the number of ways to get a target sum with n dice rolls.
Count the number of profitable schemes with given constraints.
Find the lowest price to buy items with special offers.
Calculate the probability of serving soup in a specific order.
Find the tallest billboard possible with given rods.
Practice these problems to strengthen your understanding of data structures and algorithms. Filter by difficulty, category, or search for specific problems.
Practice these problems to strengthen your understanding of data structures and algorithms.
Showing 61 of 61 problems
Determine if a string reads the same forward and backward.
Determine if one string is a scrambled version of another string.
Reverse a string to create a simple encryption system.
Check if two strings are anagrams of each other.
Find the longest common prefix among a set of strings.
Compress a string by replacing repeated characters with counts.
Implement a pattern matching algorithm for filtering emails.
Calculate the factorial of a number using recursion.
Generate the Fibonacci sequence using recursion.
Implement a binary search algorithm to find a book's position in a sorted catalog.
Solve the Tower of Hanoi puzzle using recursion.
Implement a flood fill algorithm for a digital art application's paint bucket tool.
Generate all possible permutations of a set.
Find if there exists a subset of elements that sum to a target value.
Find the largest rectangle containing only 1's in a binary matrix.
Implement a regular expression matcher with support for '.' and '*' patterns.
Count ways to paint an m×n grid with three colors such that no adjacent cells have the same color.
Find the length of the longest valid parentheses substring.
Count the number of special subsequences in a binary array.
Calculate how much rainwater can be trapped between buildings of varying heights.
Implement a wildcard pattern matcher with support for '?' and '*' patterns.
Form the largest integer with digits that add up to a target sum.
Find the largest plus sign of 1's in a grid of 0's and 1's.
Find the length of the longest palindromic subsequence in a string.
Find the longest palindromic substring in a string.
Find the maximum sum of a subarray with at most one element deletion.
Find the length of the longest Fibonacci subsequence in an array.
Make an array strictly increasing by replacing elements.
Count the number of ways to climb a staircase taking 1 or 2 steps at a time.
Find the maximum amount of money you can rob without alerting the police.
Rob houses arranged in a circle without alerting the police.
Count the number of unique paths from top-left to bottom-right of a grid.
Count unique paths in a grid with obstacles.
Find the path with the minimum sum from top-left to bottom-right in a grid.
Find the number of ways to assign + and - to reach a target sum.
Determine if an array can be partitioned into two equal sum subsets.
Find the maximum number of strings that can be formed with given limits of 0s and 1s.
Find the length of the longest turbulent subarray.
Find the minimum number of insertions needed to make a string palindromic.
Count the number of strings of length n that consist only of vowels and follow specific rules.
Count the number of distinct sequences that can be obtained with dice rolls.
Count the number of ways to tile a 2 x n board with dominos and trominos.
Find the maximum profit from buying and selling a stock once.
Find the maximum profit from buying and selling stocks with at most two transactions.
Find the maximum profit from buying and selling stocks with at most k transactions.
Find the maximum profit with a cooldown period after selling.
Find the maximum profit with a transaction fee for each trade.
Find the maximum score of a team with no age-score conflicts.
Count the number of distinct phone numbers of length n that a chess knight can dial.
Calculate the probability that a knight remains on the board after k moves.
Count the number of paths to move a ball out of a grid boundary.
Find the minimum number of operations to get n 'A's using copy and paste.
Collect maximum cherries in a grid by making two passes.
Collect maximum cherries with two robots moving simultaneously.
Count the number of possible combinations that add up to a target.
Count the number of ways to get a target sum with n dice rolls.
Count the number of profitable schemes with given constraints.
Find the lowest price to buy items with special offers.
Calculate the probability of serving soup in a specific order.
Find the tallest billboard possible with given rods.