Loading 365 Days DSA...
MasterCodeByAman
YouTube
Instagram
Linkedin
☰
Beginner
Array
Day 1
Two Sum
Notes
Solve →
Palindrome Number
Notes
Solve →
Roman to Integer
Notes
Solve →
Day 2
Find the Middle Index in Array
Notes
Solve →
Sum of Unique Elements
Notes
Solve →
Design HashMap
Notes
Solve →
Day 3
Max Consecutive Ones
Notes
Solve →
Best Time to Buy and Sell Stock
Notes
Solve →
Longest Common Prefix
Notes
Solve →
Day 4
Move Zeroes
Notes
Solve →
Missing Number
Notes
Solve →
Find the Largest Almost Missing Integer
Notes
Solve →
Day 5
Merge Sorted Array
Notes
Solve →
Pascal's Triangle
Notes
Solve →
Teemo Attacking
Notes
Solve →
Day 6
Valid Anagram
Notes
Solve →
Number of Segments in a String
Notes
Solve →
Check If Two String Arrays are Equivalent
Notes
Solve →
Day 7
Nim Game
Notes
Solve →
Divisor Game
Notes
Solve →
Find the Winning Player in Coin Game
Notes
Solve →
Day 8
Minimum Positive Sum Subarray
Notes
Solve →
Points That Intersect With Cars
Notes
Solve →
Find Pivot Index
Notes
Solve →
Day 9
Check if Array Is Sorted and Rotated
Notes
Solve →
Remove Duplicates from Sorted Array
Notes
Solve →
Find the Pivot Integer
Notes
Solve →
Day 10
Single Number
Notes
Solve →
Transpose Matrix
Notes
Solve →
Find Winner on a Tic Tac Toe Game
Notes
Solve →
Day 11
Toeplitz Matrix
Notes
Solve →
Projection Area of 3D Shapes
Notes
Solve →
Array Partition
Notes
Solve →
Day 12
Binary Prefix Divisible By 5
Notes
Solve →
Sort Array by Increasing Frequency
Notes
Solve →
Add Binary
Notes
Solve →
Day 13
Minimum Operations to Equalize Array
Notes
Solve →
Fibonacci Number
Notes
Solve →
Reverse Letters Then Special Characters in a String
Notes
Solve →
Day 14
Number of Recent Calls
Notes
Solve →
First Unique Character in a String
Notes
Solve →
Number of Students Unable to Eat Lunch
Notes
Solve →
Day 15
Sum of All Subset XOR Totals
Notes
Solve →
Distribute Candies Among Children I
Notes
Solve →
Check If Digits Are Equal in String After Operations I
Notes
Solve →
Day 16
Valid Parentheses
Notes
Solve →
Remove Outermost Parentheses
Notes
Solve →
Maximum Nesting Depth of the Parentheses
Notes
Solve →
Day 17
Excel Sheet Column Title
Notes
Solve →
Happy Number
Notes
Solve →
Base 7
Notes
Solve →
Day 18
Climbing Stairs
Notes
Solve →
Plus One
Notes
Solve →
Reverse Bits
Notes
Solve →
Day 19
Find the Index of the First Occurrence in a String
Notes
Solve →
Range Sum Query - Immutable
Notes
Solve →
Design HashSet
Notes
Solve →
Day 20
Check If It Is a Straight Line
Notes
Solve →
Valid Boomerang
Notes
Solve →
Rectangle Overlap
Notes
Solve →
Day 21
Find the K-th Character in String Game I
Notes
Solve →
Water Bottles
Notes
Solve →
Make Array Elements Equal to Zero
Notes
Solve →
Day 22
Crawler Log Folder
Notes
Solve →
Maximum Units on a Truck
Notes
Solve →
Smallest Range I
Notes
Solve →
Day 23
Find Greatest Common Divisor of Array
Notes
Solve →
Perfect Number
Notes
Solve →
Reshape the Matrix
Notes
Solve →
Day 24
Matrix Diagonal Sum
Notes
Solve →
Lucky Numbers in a Matrix
Notes
Solve →
Check if Grid Satisfies Conditions
Notes
Solve →
Day 25
Design Neighbor Sum Service
Notes
Solve →
Can Place Flowers
Notes
Solve →
Remove Digit From Number to Maximize Result
Notes
Solve →
BinarySearch
Day 32
Binary Search
Notes
Solve →
Search Insert Position
Notes
Solve →
Sqrt(x)
Notes
Solve →
Day 33
Intersection of Two Arrays (do using binary search)
Notes
Solve →
Intersection of Two Arrays II
Notes
Solve →
Valid Perfect Square
Notes
Solve →
Day 34
Find Smallest Letter Greater Than Target
Notes
Solve →
Fair Candy Swap
Notes
Solve →
Count Complete Tree Nodes
Notes
Solve →
Day 35
Floor in a Sorted Array
Notes
Solve →
LinkedList
Day 26
Insertion at a Given Position in a Linked List
Notes
Solve →
Remove Linked List Elements
Notes
Solve →
Merge Two Sorted Lists
Notes
Solve →
Day 27
Reverse Linked List
Notes
Solve →
Palindrome Linked List
Notes
Solve →
Intersection of Two Linked Lists
Notes
Solve →
Day 28
Remove Duplicates from Sorted List
Notes
Solve →
Middle of the Linked List (Hare and Tortoise method)
Notes
Solve →
Linked List Cycle
Notes
Solve →
Day 29
Convert Binary Number in a Linked List to Integer
Notes
Solve →
String
Day 38
Longest Common Prefix
Notes
Solve →
Valid Palindrome
Notes
Solve →
Isomorphic Strings
Notes
Solve →
Day 39
Reverse Vowels of a String
Notes
Solve →
Ransom Note
Notes
Solve →
Word Pattern
Notes
Solve →
Day 40
Is Subsequence
Notes
Solve →
Longest Palindrome
Notes
Solve →
Convert a Number to Hexadecimal
Notes
Solve →
Day 41
Second Largest Digit in a String
Notes
Solve →
License Key Formatting
Notes
Solve →
Intermediate
Array
Day 47
3Sum
Notes
Solve →
4Sum
Notes
Solve →
Maximum Subarray
Notes
Solve →
Day 48
Construct the Minimum Bitwise Array II
Notes
Solve →
Maximum Product Subarray
Notes
Solve →
Maximum Number of Distinct Elements After Operations
Notes
Solve →
Day 49
Container With Most Water
Notes
Solve →
Merge Intervals
Notes
Solve →
Furthest Building You Can Reach
Notes
Solve →
📊 Stats
0%
Solved: 0 / 321
Ceil in a Sorted Array
Notes
Solve →
Number of occurrence
Notes
Solve →
Day 36
Kth Missing Positive Number
Notes
Solve →
First Bad Version
Notes
Solve →
Arranging Coins
Notes
Solve →
Day 37
Valid Perfect Square
Notes
Solve →
Check If N and Its Double Exist
Notes
Solve →
Count the Number of Incremovable Subarrays I
Notes
Solve →
Introduction to Doubly Linked List
Notes
Solve →
Reverse a Doubly Linked List
Notes
Solve →
Day 30
Pair Sum in Doubly Linked List
Notes
Solve →
Remove duplicates from a sorted doubly linked list
Notes
Solve →
Add 1 to a Linked List Number
Notes
Solve →
Day 31
Split a Linked List into two halves
Notes
Solve →
Rotate doubly Linked List
Notes
Solve →
Stack using Linked List
Notes
Solve →
Reverse Words in a String III
Notes
Solve →
Day 42
Rotate String
Notes
Solve →
Minimum Moves to Convert String
Notes
Solve →
Find the K-Beauty of a Number
Notes
Solve →
Day 43
Find Resultant Array After Removing Anagrams
Notes
Solve →
Strong Password Checker II
Notes
Solve →
Shortest Distance to Target String in a Circular Array
Notes
Solve →
Day 44
Find the Longest Balanced Substring of a Binary String
Notes
Solve →
Check if Strings Can be Made Equal With Operations I
Notes
Solve →
Most Common Word
Notes
Solve →
Day 45
Greatest Common Divisor of Strings
Notes
Solve →
Day of the Year
Notes
Solve →
Remove Palindromic Subsequences
Notes
Solve →
Day 46
String Matching in an Array
Notes
Solve →
String Rotation Game
Notes
Solve →
New Year String
Notes
Solve →
Day 50
Add Minimum Number of Rungs
Notes
Solve →
Number of Ways to Split Array
Notes
Solve →
Four Divisors
Notes
Solve →
Day 51
Maximum Area of a Piece of Cake After Horizontal and Vertical Cuts
Notes
Solve →
Gas Station
Notes
Solve →
Number of Boomerangs
Notes
Solve →
Day 52
Maximum Number of Vowels in a Substring of Given Length
Notes
Solve →
Group Anagrams
Notes
Solve →
Maximum Product of Word Lengths
Notes
Solve →
Day 53
Sum Game
Notes
Solve →
Remove Colored Pieces if Both Neighbors are the Same Color
Notes
Solve →
Vowels Game in a String
Notes
Solve →
Day 54
Find the N-th Value After K Seconds
Notes
Solve →
Product of Array Except Self
Notes
Solve →
Continuous Subarray Sum
Notes
Solve →
Day 55
Majority Element
Notes
Solve →
Shift Distance Between Two Strings
Notes
Solve →
Sum of Absolute Differences in a Sorted Array
Notes
Solve →
Day 56
Rotate Array
Notes
Solve →
Number of Smooth Descent Periods of a Stock
Notes
Solve →
Advantage Shuffle
Notes
Solve →
Day 57
Sort Colors
Notes
Solve →
Rearrange Array Elements by Sign
Notes
Solve →
Majority Element II
Notes
Solve →
Day 58
Longest Consecutive Sequence
Notes
Solve →
Rotate Image
Notes
Solve →
Subarray Sum Equals K
Notes
Solve →
Day 59
Spiral Matrix
Notes
Solve →
Maximum Number of Coins You Can Get
Notes
Solve →
Movement of Robots
Notes
Solve →
Day 60
Set Matrix Zeroes
Notes
Solve →
Count Inversions
Notes
Solve →
Reverse Pairs
Notes
Solve →
Day 61
Minimum K to Reduce Array Within Limit
Notes
Solve →
Longest Strictly Increasing Subsequence With Non-Zero Bitwise AND
Notes
Solve →
Maximum Rows Covered by Columns
Notes
Solve →
Day 62
Score of Parentheses
Notes
Solve →
Minimum Insertions to Balance a Parentheses String
Notes
Solve →
Longest Subarray of 1's After Deleting One Element
Notes
Solve →
Day 63
Next Permutation
Notes
Solve →
Matchsticks to Square
Notes
Solve →
Minimum Number of Work Sessions to Finish the Tasks
Notes
Solve →
Day 64
Longest Substring Without Repeating Characters
Notes
Solve →
String to Integer (atoi)
Notes
Solve →
Divide Two Integers
Notes
Solve →
Day 65
Range Sum Query 2D - Immutable
Notes
Solve →
Range Sum Query - Mutable
Notes
Solve →
Design Twitter
Notes
Solve →
Day 66
Rectangle Area
Notes
Solve →
Valid Square
Notes
Solve →
Circle and Rectangle Overlapping
Notes
Solve →
Day 67
Repeated DNA Sequences
Notes
Solve →
Reschedule Meetings for Maximum Free Time I
Notes
Solve →
Reschedule Meetings for Maximum Free Time II
Notes
Solve →
Day 68
Count Subarrays with given XOR
Notes
Solve →
Pow(x, n)
Notes
Solve →
Prime Pairs With Target Sum
Notes
Solve →
Day 69
Determine if a Cell Is Reachable at a Given Time
Notes
Solve →
Clumsy Factorial
Notes
Solve →
Convert to Base -2
Notes
Solve →
Day 70
Valid Sudoku
Notes
Solve →
Game of Life
Notes
Solve →
Valid Tic-Tac-Toe State
Notes
Solve →
Day 71
Insert Delete GetRandom O(1)
Notes
Solve →
Online Stock Span
Notes
Solve →
Simple Bank System
Notes
Solve →
BinarySearch
Day 81
Find First and Last Position of Element in Sorted Array
Notes
Solve →
Single Element in a Sorted Array
Notes
Solve →
Find Peak Element
Notes
Solve →
Day 82
Search a 2D Matrix
Notes
Solve →
Search in Rotated Sorted Array
Notes
Solve →
Search in Rotated Sorted Array II
Notes
Solve →
Day 83
Two Sum II - Input Array Is Sorted
Notes
Solve →
Search a 2D Matrix II
Notes
Solve →
Random Pick with Weight
Notes
Solve →
Day 84
Find nth root of m
Notes
Solve →
Allocate Minimum Pages
Notes
Solve →
Find Minimum in Rotated Sorted Array
Notes
Solve →
Day 85
Koko Eating Bananas
Notes
Solve →
Minimum Number of Days to Make m Bouquets
Notes
Solve →
Find the Smallest Divisor Given a Threshold
Notes
Solve →
Day 86
Capacity To Ship Packages Within D Days
Notes
Solve →
Aggressive Cows
Notes
Solve →
The Painter's Partition Problem-II
Notes
Solve →
Day 87
Total Score of Dungeon Runs
Notes
Solve →
Maximum Capacity Within Budget
Notes
Solve →
Design Exam Scores Tracker
Notes
Solve →
Day 88
Longest Increasing Subsequence
Notes
Solve →
Minimum Speed to Arrive on Time
Notes
Solve →
Split Array Largest Sum
Notes
Solve →
Day 89
Minimum Limit of Balls in a Bag
Notes
Solve →
Find a Peak Element II
Notes
Solve →
Plates Between Candles
Notes
Solve →
Day 90
Minimum Time to Repair Cars
Notes
Solve →
Minimum Time to Complete All Deliveries
Notes
Solve →
Median of Two Sorted Arrays
Notes
Solve →
Day 91
Minimum Time to Complete Trips
Notes
Solve →
K-th element of two Arrays
Notes
Solve →
Prime Subtraction Operation
Notes
Solve →
Day 92
Minimum Time to Activate String
Notes
Solve →
Maximum Coins From K Consecutive Bags
Notes
Solve →
Median in a row-wise sorted Matrix
Notes
Solve →
Day 93
Separate Squares I
Notes
Solve →
Minimize Maximum Component Cost
Notes
Solve →
Maximum Number That Sum of the Prices Is Less Than or Equal to K
Notes
Solve →
Day 94
Ugly Number III
Notes
Solve →
My Calendar I
Notes
Solve →
Nth Digit
Notes
Solve →
Day 95
Interesting drink
Notes
Solve →
K-th Not Divisible by n
Notes
Solve →
Sagheer and Nubian Market
Notes
Solve →
LinkedList
Day 72
Add Two Numbers
Notes
Solve →
Remove Nth Node From End of List
Notes
Solve →
Odd Even Linked List
Notes
Solve →
Day 73
Design Linked List
Notes
Solve →
Next Greater Node In Linked List
Notes
Solve →
Delete Node in a Linked List
Notes
Solve →
Day 74
Linked List Cycle II
Notes
Solve →
Delete the Middle Node of a Linked List
Notes
Solve →
Reverse Linked List II
Notes
Solve →
Day 75
Sort List
Notes
Solve →
Rotate List
Notes
Solve →
Copy List with Random Pointer
Notes
Solve →
Day 76
Delete all occurrences of a given key in a doubly linked list
Notes
Solve →
Find length of Loop
Notes
Solve →
Reverse Nodes in k-Group
Notes
Solve →
Day 77
Partition a Linked List around a given value
Notes
Solve →
Binary Tree to DLL
Notes
Solve →
Swap Nodes in Pairs
Notes
Solve →
Day 78
Flattening a Linked List
Notes
Solve →
Sort a linked list of 0s, 1s and 2s
Notes
Solve →
LRU Cache
Notes
Solve →
Day 79
Design Browser History
Notes
Solve →
Design Authentication Manager
Notes
Solve →
LFU Cache
Notes
Solve →
Day 80
Merge K sorted linked lists
Notes
Solve →
Remove loop in Linked List
Notes
Solve →
Reorder List
Notes
Solve →
String
Day 96
Decode String
Notes
Solve →
Compare Version Numbers
Notes
Solve →
Reverse Words in a String
Notes
Solve →
Day 97
Fraction to Recurring Decimal
Notes
Solve →
Sum of Beauty of All Substrings
Notes
Solve →
Basic Calculator II
Notes
Solve →
Day 98
Integer to Roman
Notes
Solve →
Count and Say
Notes
Solve →
Simplify Path
Notes
Solve →
Day 99
Restore IP Addresses
Notes
Solve →
Sort Characters By Frequency
Notes
Solve →
Minimum Add to Make Parentheses Valid
Notes
Solve →
Day 100
Search Pattern (Rabin-Karp Algorithm)
Notes
Solve →
Search Pattern (Using KMP Algo)
Notes
Solve →
Search Pattern (Z-algorithm)
Notes
Solve →
Day 101
Remove K Digits
Notes
Solve →
Reconstruct Original Digits from English
Notes
Solve →
Longest Happy Prefix
Notes
Solve →
Day 102
Encode and Decode TinyURL
Notes
Solve →
Minimum Time Difference
Notes
Solve →
Next Greater Element III
Notes
Solve →
Day 103
Dota2 Senate
Notes
Solve →
Implement Magic Dictionary
Notes
Solve →
Repeated String Match
Notes
Solve →
Day 104
Merge Close Characters
Notes
Solve →
Maximum Bitwise XOR After Rearrangement
Notes
Solve →
Number of Prefix Connected Groups
Notes
Solve →
Day 105
Maximum Score After Binary Swaps
Notes
Solve →
Minimum Cost to Make Two Binary Strings Equal
Notes
Solve →
Longest Balanced Substring II
Notes
Solve →
Day 106
Decoded String at Index
Notes
Solve →
Time Based Key-Value Store
Notes
Solve →
String Without AAA or BBB
Notes
Solve →
Day 107
Binary String With Substrings Representing 1 To N
Notes
Solve →
Robot Bounded In Circle
Notes
Solve →
Invalid Transactions
Notes
Solve →