101 Logo
onenoughtone

DSA Problems

Problem Collection

Practice these problems to strengthen your understanding of data structures and algorithms. Filter by difficulty, category, or search for specific problems.

Filter Problems

Problems (61)

Palindrome Checker
Easy

Determine if a string reads the same forward and backward.

String ManipulationTwo Pointers
Category: Strings

Scramble String
Hard

Determine if one string is a scrambled version of another string.

StringDynamic ProgrammingRecursion
Category: Strings

Message Encryption
Easy

Reverse a string to create a simple encryption system.

String ManipulationIn-place Modification
Category: Strings

Word Puzzle Challenge
Easy

Check if two strings are anagrams of each other.

String ManipulationHash Table
Category: Strings

DNA Sequence Analysis
Medium

Find the longest common prefix among a set of strings.

String ManipulationArray Processing
Category: Strings

File Compression System
Medium

Compress a string by replacing repeated characters with counts.

String ManipulationRun-Length Encoding
Category: Strings

Email Filter System
Hard

Implement a pattern matching algorithm for filtering emails.

String ManipulationDynamic Programming
Category: Strings

Factorial Calculator
Easy

Calculate the factorial of a number using recursion.

RecursionMath
Category: Recursion

Fibonacci Sequence
Easy

Generate the Fibonacci sequence using recursion.

RecursionDynamic Programming
Category: Recursion

Library Book Finder
Easy

Implement a binary search algorithm to find a book's position in a sorted catalog.

RecursionDivide & ConquerBinary SearchSearching
Category: Recursion

Tower of Hanoi
Medium

Solve the Tower of Hanoi puzzle using recursion.

RecursionProblem Solving
Category: Recursion

Digital Paint Bucket Tool
Medium

Implement a flood fill algorithm for a digital art application's paint bucket tool.

RecursionDFSGraphMatrix
Category: Recursion

Shift Scheduler
Medium

Generate all possible permutations of a set.

RecursionBacktracking
Category: Recursion

Hiking Backpack Packer
Medium

Find if there exists a subset of elements that sum to a target value.

RecursionDynamic Programming
Category: Recursion

Maximal Rectangle
Hard

Find the largest rectangle containing only 1's in a binary matrix.

Dynamic ProgrammingStackMatrixHistogram
Category: Dynamic Programming

Regular Expression Matcher
Hard

Implement a regular expression matcher with support for '.' and '*' patterns.

Dynamic ProgrammingStringRecursionPattern Matching
Category: Dynamic Programming

Painting a Grid
Hard

Count ways to paint an m×n grid with three colors such that no adjacent cells have the same color.

Dynamic ProgrammingCombinatoricsMatrix
Category: Dynamic Programming

Parentheses Validator
Hard

Find the length of the longest valid parentheses substring.

Dynamic ProgrammingStringStack
Category: Dynamic Programming

Special Subsequence Counter
Hard

Count the number of special subsequences in a binary array.

Dynamic ProgrammingArraySubsequence
Category: Dynamic Programming

Rain Water Collector
Hard

Calculate how much rainwater can be trapped between buildings of varying heights.

Dynamic ProgrammingArrayTwo PointersStack
Category: Dynamic Programming

Wildcard Pattern Matcher
Hard

Implement a wildcard pattern matcher with support for '?' and '*' patterns.

Dynamic ProgrammingStringGreedyPattern Matching
Category: Dynamic Programming

Largest Integer Former
Hard

Form the largest integer with digits that add up to a target sum.

Dynamic ProgrammingGreedyBacktracking
Category: Dynamic Programming

Largest Plus Sign Finder
Medium

Find the largest plus sign of 1's in a grid of 0's and 1's.

Dynamic ProgrammingMatrixPrefix Sum
Category: Dynamic Programming

Palindromic Subsequence Finder
Medium

Find the length of the longest palindromic subsequence in a string.

Dynamic ProgrammingStringPalindrome
Category: Dynamic Programming

Palindromic Substring Finder
Medium

Find the longest palindromic substring in a string.

Dynamic ProgrammingStringPalindrome
Category: Dynamic Programming

Maximum Subarray Finder
Medium

Find the maximum sum of a subarray with at most one element deletion.

Dynamic ProgrammingArrayKadane's Algorithm
Category: Dynamic Programming

Fibonacci Subsequence Finder
Medium

Find the length of the longest Fibonacci subsequence in an array.

Dynamic ProgrammingArrayHash Table
Category: Dynamic Programming

Array Increaser
Hard

Make an array strictly increasing by replacing elements.

Dynamic ProgrammingArrayBinary Search
Category: Dynamic Programming

Climbing Stairs
Easy

Count the number of ways to climb a staircase taking 1 or 2 steps at a time.

Dynamic ProgrammingFibonacciRecursion
Category: Dynamic Programming

House Robber
Medium

Find the maximum amount of money you can rob without alerting the police.

Dynamic ProgrammingArray
Category: Dynamic Programming

House Robber II
Medium

Rob houses arranged in a circle without alerting the police.

Dynamic ProgrammingArrayCircular Array
Category: Dynamic Programming

Unique Paths
Medium

Count the number of unique paths from top-left to bottom-right of a grid.

Dynamic ProgrammingCombinatoricsMath
Category: Dynamic Programming

Unique Paths II
Medium

Count unique paths in a grid with obstacles.

Dynamic ProgrammingArrayMatrix
Category: Dynamic Programming

Minimum Path Sum
Medium

Find the path with the minimum sum from top-left to bottom-right in a grid.

Dynamic ProgrammingArrayMatrix
Category: Dynamic Programming

Target Sum
Medium

Find the number of ways to assign + and - to reach a target sum.

Dynamic ProgrammingDFSBacktracking
Category: Dynamic Programming

Partition Equal Subset Sum
Medium

Determine if an array can be partitioned into two equal sum subsets.

Dynamic ProgrammingArraySubset Sum
Category: Dynamic Programming

Ones and Zeroes
Medium

Find the maximum number of strings that can be formed with given limits of 0s and 1s.

Dynamic ProgrammingArrayString
Category: Dynamic Programming

Longest Turbulent Subarray
Medium

Find the length of the longest turbulent subarray.

Dynamic ProgrammingArraySliding Window
Category: Dynamic Programming

Minimum Insertions for Palindrome
Hard

Find the minimum number of insertions needed to make a string palindromic.

Dynamic ProgrammingStringPalindrome
Category: Dynamic Programming

Count Vowels Permutation
Hard

Count the number of strings of length n that consist only of vowels and follow specific rules.

Dynamic ProgrammingCombinatorics
Category: Dynamic Programming

Dice Roll Simulation
Hard

Count the number of distinct sequences that can be obtained with dice rolls.

Dynamic ProgrammingProbability
Category: Dynamic Programming

Domino and Tromino Tiling
Medium

Count the number of ways to tile a 2 x n board with dominos and trominos.

Dynamic ProgrammingCombinatorics
Category: Dynamic Programming

Best Time to Buy and Sell Stock
Easy

Find the maximum profit from buying and selling a stock once.

Dynamic ProgrammingArrayGreedy
Category: Dynamic Programming

Best Time to Buy and Sell Stock III
Hard

Find the maximum profit from buying and selling stocks with at most two transactions.

Dynamic ProgrammingArray
Category: Dynamic Programming

Best Time to Buy and Sell Stock IV
Hard

Find the maximum profit from buying and selling stocks with at most k transactions.

Dynamic ProgrammingArray
Category: Dynamic Programming

Best Time to Buy and Sell Stock with Cooldown
Medium

Find the maximum profit with a cooldown period after selling.

Dynamic ProgrammingArrayState Machine
Category: Dynamic Programming

Best Time to Buy and Sell Stock with Transaction Fee
Medium

Find the maximum profit with a transaction fee for each trade.

Dynamic ProgrammingArrayGreedy
Category: Dynamic Programming

Best Team with No Conflicts
Medium

Find the maximum score of a team with no age-score conflicts.

Dynamic ProgrammingArraySorting
Category: Dynamic Programming

Knight Dialer
Medium

Count the number of distinct phone numbers of length n that a chess knight can dial.

Dynamic ProgrammingGraph
Category: Graphs

Knight Probability in Chessboard
Medium

Calculate the probability that a knight remains on the board after k moves.

Dynamic ProgrammingGraphProbability
Category: Graphs

Out of Boundary Paths
Medium

Count the number of paths to move a ball out of a grid boundary.

Dynamic ProgrammingGraphRecursion
Category: Graphs

Reducing Dishes
Hard

Find the maximum sum of satisfaction you can get by cooking some dishes.

GreedyDynamic ProgrammingSorting
Category: Greedy

Two Keys Keyboard
Medium

Find the minimum number of operations to get n 'A's using copy and paste.

Dynamic ProgrammingMathPrime Factorization
Category: Miscellaneous

Cherry Pickup
Hard

Collect maximum cherries in a grid by making two passes.

Dynamic ProgrammingGrid
Category: Miscellaneous

Cherry Pickup II
Hard

Collect maximum cherries with two robots moving simultaneously.

Dynamic ProgrammingGrid
Category: Miscellaneous

Combination Sum IV
Medium

Count the number of possible combinations that add up to a target.

Dynamic ProgrammingCombinatorics
Category: Miscellaneous

Dice Roll Simulation
Medium

Count the number of ways to get a target sum with n dice rolls.

Dynamic ProgrammingCombinatorics
Category: Miscellaneous

Profitable Schemes
Hard

Count the number of profitable schemes with given constraints.

Dynamic ProgrammingKnapsack
Category: Miscellaneous

Shopping Offers
Medium

Find the lowest price to buy items with special offers.

Dynamic ProgrammingRecursionMemoization
Category: Miscellaneous

Soup Servings
Medium

Calculate the probability of serving soup in a specific order.

Dynamic ProgrammingProbability
Category: Miscellaneous

Tallest Billboard
Hard

Find the tallest billboard possible with given rods.

Dynamic ProgrammingKnapsack
Category: Miscellaneous
ConceptProblemsPractice
101 Logo
onenoughtone