KEMBAR78
DSA - QUESTIONS Basic, Medium & Advanced | PDF | String (Computer Science) | Queue (Abstract Data Type)
0% found this document useful (0 votes)
131 views54 pages

DSA - QUESTIONS Basic, Medium & Advanced

The document outlines a 90-hour basic level Data Structures and Algorithms (DSA) course, detailing topics covered each day, including arrays, strings, stacks, queues, and linked lists, along with associated coding problems from platforms like LeetCode and HackerRank. It emphasizes time and space complexity, various data structure operations, and includes practical exercises to enhance understanding. The course is structured over 30 days, with specific problems and concepts assigned to each day for comprehensive learning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
131 views54 pages

DSA - QUESTIONS Basic, Medium & Advanced

The document outlines a 90-hour basic level Data Structures and Algorithms (DSA) course, detailing topics covered each day, including arrays, strings, stacks, queues, and linked lists, along with associated coding problems from platforms like LeetCode and HackerRank. It emphasizes time and space complexity, various data structure operations, and includes practical exercises to enhance understanding. The course is structured over 30 days, with specific problems and concepts assigned to each day for comprehensive learning.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 54

DSA Basic Level_90hrs

Days Topic Questions

What is a Data Structure?


Types of Data Structures
Classification of Data Structures
Abstract Data Types (ADTs)
Operations on Data Structures
Data Structrures Time Complexity
Introduction Big-O Notation
Day-1
Time Complexity Best, Worst, and Average Case
Space Complexity Analysis
Space Complexity
arrays basics, string basics, arrays
manipulations & string
manipulations,Stacks,Queues,Linke
dLists

LeetCode #1 - Two Sum

LeetCode #26 - Remove Duplicates from


Sorted Array

Day-2 Arrays LeetCode #27 - Remove Element

LeetCode #53 - Maximum Subarray

LeetCode #121 - Best Time to Buy and


Sell Stock

LeetCode #136 - Single Number

LeetCode #283 - Move Zeroes

Day-3 Arrays
LeetCode #485 - Max Consecutive Ones

LeetCode #561 - Array Partition I

LeetCode #566 - Reshape the Matrix

LeetCode #704 - Binary Search

LeetCode #724 - Find Pivot Index

LeetCode #977 - Squares of a Sorted


Day-4 Arrays
Array

LeetCode #1089 - Duplicate Zeros

LeetCode #1295 - Find Numbers with


Even Number of Digits
HackerRank #Arrays - DS

HackerRank #2D Array - DS

HackerRank #Left Rotation


Day-5 Arrays
HackerRank #Dynamic Array

HackerRank #Array Manipulation

HackerRank #Sparse Arrays

HackerRank #Minimum Swaps 2

Day-6 Arrays HackerRank #New Year Chaos

HackerRank #Equalize the Array

HackerRank #Lonely Integer

LeetCode #14 – Longest Common Prefix

LeetCode #20 – Valid Parentheses

LeetCode #28 – Find the Index of the


First Occurrence in a String
Day-7 Strings
LeetCode #58 – Length of Last Word

LeetCode #125 – Valid Palindrome

LeetCode #344 – Reverse String

LeetCode #345 – Reverse Vowels of a


String
LeetCode #387 – First Unique Character
Day-8 Strings
in a String

LeetCode #383 – Ransom Note

LeetCode #709 – To Lower Case

LeetCode #796 – Rotate String

Day-9 Strings
LeetCode #804 – Unique Morse Code
Words
LeetCode #1108 – Defanging an IP
Day-9 Strings
Address

LeetCode #1528 – Shuffle String

LeetCode #2011 – Final Value of


Variable After Performing Operations

HackerRank #Strings: Making Anagrams

HackerRank #CamelCase

Day-10 Strings HackerRank #Two Characters

HackerRank #The Love-Letter Mystery

HackerRank #Alternating Characters

HackerRank #Super Reduced String

HackerRank #Strong Password

HackerRank #Beautiful Binary String


Day-11 Strings

HackerRank #Funny String

HackerRank #Pangrams

LeetCode #20 – Valid Parentheses

LeetCode #155 – Min Stack

LeetCode #232 – Implement Queue


Day-12 Stacks
using Stacks
LeetCode #225 – Implement Stack using
Queues

LeetCode #739 – Daily Temperatures

LeetCode #496 – Next Greater Element


I

LeetCode #682 – Baseball Game

LeetCode #844 – Backspace String


Day-13 Stacks
Compare
Day-13 Stacks

LeetCode #1047 – Remove All Adjacent


Duplicates In String

LeetCode #856 – Score of Parentheses

LeetCode #901 – Online Stock Span

LeetCode #1021 – Remove Outermost


Parentheses

LeetCode #1544 – Make The String


Day-14 Stacks Great

HackerRank #Balanced Brackets

HackerRank #Equal Stacks

HackerRank #Game of Two Stacks

HackerRank #Largest Rectangle

Day-15 Stacks HackerRank #Poisonous Plants

HackerRank #Waiter

HackerRank #Simple Text Editor

HackerRank #Maximum Element

HackerRank #Castle on the Grid (DFS +


Stack)

Day-16 Stacks HackerRank #AND xor OR

HackerRank #Simple Parser

HackerRank #String Reduction (Stack


version)
LeetCode #933 – Number of Recent
Calls

LeetCode #346 – Moving Average from


Data Stream

Day-17 Queues
LeetCode #641 – Design Circular Deque

LeetCode #622 – Design Circular Queue

LeetCode #1700 – Number of Students


Unable to Eat Lunch
HackerRank #Queue using Two Stacks
HackerRank #Castle on the Grid (BFS
Queue)

HackerRank #Truck Tour


Day-18 Queues
HackerRank #Down to Zero II

HackerRank #Jesse and Cookies

LeetCode #21 – Merge Two Sorted Lists

LeetCode #83 – Remove Duplicates


from Sorted List
Day-19 LinkedLists LeetCode #206 – Reverse Linked List
LeetCode #876 – Middle of the Linked
List

LeetCode #141 – Linked List Cycle

LeetCode #203 – Remove Linked List


Elements

LeetCode #234 – Palindrome Linked List

LeetCode #160 – Intersection of Two


Day-20 LinkedLists
Linked Lists

LeetCode #2 – Add Two Numbers

LeetCode #19 – Remove N-th Node


from End of List
LeetCode #24 – Swap Nodes in Pairs
LeetCode #82 – Remove Duplicates
from Sorted List II

LeetCode #92 – Reverse Linked List II


Day-21 LinkedLists
HackerRank #Print the Elements of a
Linked List
HackerRank #Insert a Node at the Tail of
a Linked List
HackerRank #Insert a Node at the Head
of a Linked List
HackerRank #Insert a Node at a Specific
Position in a Linked List
Day-22 LinkedLists
HackerRank #Delete a Node

HackerRank #Print in Reverse


HackerRank #Reverse a Linked List
HackerRank #Compare Two Linked Lists

HackerRank #Merge Two Sorted Linked


Lists

Day-23 LinkedLists
Day-23 LinkedLists HackerRank #Get Node Value

HackerRank #Remove Duplicates

HackerRank #Cycle Detection

LeetCode #704 – Binary Search

LeetCode #278 – First Bad Version


Day-24 Searchings & Sortings
LeetCode #35 – Search Insert Position

LeetCode #852 – Peak Index in a


Mountain Array
LeetCode #367 – Valid Perfect Square
LeetCode #744 – Find Smallest Letter
Greater Than Target
HackerRank #Binary Search: Ice Cream
Parlor

HackerRank #Binary Search: Pairs


Day-25 Searchings & Sortings

HackerRank #Sherlock and Array

HackerRank #Missing Numbers

HackerRank #Minimum Time Required

HackerRank #Binary Search Trees:


Lowest Common Ancestor

Day-26 Searchings & Sortings LeetCode #912 – Sort an Array

LeetCode #88 – Merge Sorted Array

LeetCode #977 – Squares of a Sorted


Array
LeetCode #75 – Sort Colors (Dutch
National Flag Problem)

LeetCode #164 – Maximum Gap

Day-27 Searchings & Sortings


LeetCode #561 – Array Partition I

LeetCode #1356 – Sort Integers by The


Number of 1 Bits

HackerRank #Bubble Sort: Sorting

HackerRank #Insertion Sort - Part 1


HackerRank #Insertion Sort - Part 2
HackerRank #Quicksort 1 - Partition
Day-28 Searchings & Sortings
Day-28 Searchings & Sortings
HackerRank #Counting Sort 1

HackerRank #Mark and Toys

LeetCode #700 – Search in a Binary


Search Tree

LeetCode #701 – Insert into a Binary


Search Tree
Binary Search
Day-29 LeetCode #450 – Delete Node in a BST
Trees(BST)
LeetCode #98 – Validate Binary Search
Tree

LeetCode #530 – Minimum Absolute


Difference in BST

HackerRank #Binary Search Tree:


Insertion
HackerRank #Binary Search Tree:
Search
Binary Search HackerRank #Binary Search Tree:
Day-30
Trees(BST) Height of a Binary Tree
HackerRank #Binary Search Tree:
Lowest Common Ancestor
HackerRank #Binary Search Tree:
Check BST
90hrs
Description DurationHrs)

Diagramatic Representations with


3
Expalnations

Given an array of integers, return indices


of the two numbers such that they add
up to a specific target.
Remove duplicates in-place from a
sorted array and return the new length.

Remove all instances of a specific value


3
in-place and return the new length.

Find the contiguous subarray with the


largest sum.
Given prices of a stock over days, find
the maximum profit with one buy and
one sell.
Every element appears twice except for
one. Find that single one.
Move all zeroes to the end of the array
while maintaining the relative order of
non-zero elements.
Find the maximum number of 3
consecutive 1s in a binary array.
Partition array into pairs to maximize the
sum of the minimums of each pair.
Reshape a 2D matrix into a new one
with a different size.
Implement binary search to find a target
value in a sorted array.
Find the pivot index where the sum of
the left equals the sum on the right.
Return the squares of each number in a
3
sorted array, also sorted.
Duplicate each occurrence of zero,
shifting the remaining elements.
Count how many numbers in the array
contain an even number of digits.
Reverse a given array of integers and
print the result.
Calculate the hourglass sum for every
hourglass in a 6x6 array.
Perform left rotations on an array and
print the updated array. 3
Implement a dynamic array and process
a list of queries.
Perform a range update on an array
using queries and return the maximum
value.

Given a list of strings and queries, count


the occurrences of each query string.

Find the minimum number of swaps


required to sort the array in ascending
order.
Determine the minimum number of
bribes that took place to get to a given 3
queue state.
Delete elements to make all elements
equal. Return the minimum number of
deletions.

Find the element that occurs only once


in the array where all others occur twice.

Find the longest common prefix string


amongst an array of strings.
Check if the input string of brackets is
valid (properly closed and nested).
Implement strStr() – return the index of
the first occurrence of a substring.
Given a string s consisting of words and 3
spaces, return the length of the last
word.
Return true if the given string is a
palindrome considering only
alphanumeric characters and ignoring
cases.
Write a function that reverses a string.
Do it in-place.
Reverse only the vowels of a given
string.
Find the first non-repeating character
3
and return its index.
Return true if ransomNote can be
constructed from magazine letters.
Convert all uppercase letters in a string
to lowercase.
Check if s can become goal after some
number of shifts.

3
Return the number of different Morse
code representations of given words.
Return a defanged version of the IP
3
address.

Restore the string from shuffled indices.

Return the final value after performing


increment/decrement operations.
Determine the minimum number of
character deletions required to make two
strings anagrams.
Count the number of words in a
camelCase string.

Delete characters from the string so that


3
only two alternating characters remain.

Calculate the minimum number of


operations to convert a string into a
palindrome.
Remove consecutive repeating
characters to make the string alternate.
Reduce the string by removing pairs of
adjacent matching characters.
Determine the number of characters
needed to make the password strong.
Count the number of steps to make the
binary string beautiful (no "010"
substrings). 3

Determine if the string is funny (based


on ASCII differences between
characters).
Check if a string is a pangram (contains
all 26 English letters).
Check for balanced parentheses using a
stack.
Design a stack that supports push, pop,
top, and retrieving the minimum element
in constant time.

Use two stacks to implement a queue. 3

Use two queues to implement a stack.

Return an array such that each element


is the number of days until a warmer
temperature.
Find the next greater element of one
array's elements in another array.
Evaluate a list of operations like "C", "D",
"+", and integers as a stack game.
Compare two strings after simulating
3
backspace characters using stacks.
3

Remove all adjacent duplicates using a


stack approach.
Compute the score of a balanced
parentheses string.
Design a stock span calculator using
stack to return consecutive days of stock
price drop.
Remove the outermost parentheses of
every primitive string in the input.
Remove adjacent characters if they are
the same letter but different cases using
a stack. 3

Check whether the input string's


brackets are balanced using stack logic.

Given three stacks of cylinders, find the


maximum height at which all stacks are
equal.
Determine the maximum number of
elements that can be removed from two
stacks without exceeding a sum limit.
Find the largest rectangular area
possible in a histogram.
Determine how many days until no
plants die based on pesticide levels 3
using a stack.
Implement a stack-based number
filtering game with prime numbers as
divisors.
Implement a simple text editor with
stack-based undo operations.
Create a stack that returns the current
maximum value efficiently.
Find the minimum moves required using
stack-based DFS on a grid.
Evaluate the expression values from an
3
array using stacks.
Parse nested expressions or commands
using stack-based parsing.
Reduce a string by removing specific
adjacent pairs with stack logic.
Count how many calls happened in the
last 3000 milliseconds using a queue.
Design a class that finds the moving
average of the last 'n' values in a data
stream.
Implement a double-ended queue with 3
circular behavior.
Design a fixed-size circular queue with
operations for insertion and deletion.
Use queue logic to simulate students
picking sandwiches in order.
Implement a queue using two stacks.
Find the minimum number of moves in a
grid using BFS (queue-based).
Determine the starting petrol pump index
to complete the tour.
3
Use BFS with queue to find the minimum
steps to reduce a number to zero.

Combine the two least sweet cookies


repeatedly using a priority queue (min-
heap).
Merge two sorted linked lists and return
it as a new sorted list.
Remove all duplicates such that each
element appears only once.
Reverse a singly linked list. 3
Return the middle node of a linked list.

Detect if the linked list contains a cycle.

Remove all elements of a linked list


equal to a given value.
Check if a singly linked list is a
palindrome.
Find the node at which two linked lists
3
intersect.
Add two numbers represented by linked
lists.
Remove the n-th node from the end of a
linked list.
Swap every two adjacent nodes.
Remove all nodes that have duplicate
numbers.
Reverse a sublist of a linked list between
two positions. 3
Traverse and print elements from a
singly linked list.

Add a new node at the end.

Add a new node at the beginning.

Insert a new node at a given index.

Delete a node at a given position in a 3


singly linked list.
Print the linked list elements in reverse
order.
Reverse the given singly linked list.
Return true if two linked lists are
identical.
Merge two sorted linked lists into a
single sorted list.

3
Find the value of the node at a specific
3
position from the tail.
Remove duplicates from a sorted linked
list.

Determine if a cycle exists in a linked list.

Implement binary search in a sorted


array.
Find the first bad version using binary
search.
Find the index to insert the target using 3
binary search.
Return the peak index in a mountain
array using binary search.
LeetCode #367 – Valid Perfect Square
Use binary search on a sorted character
array.
Use binary search to find two items that
sum up to a target.
Find the number of pairs with a specific
difference. 3
Check if there exists an element in an
array where the sum on left and right is
equal.
Find missing numbers from a given list
compared to a reference list.
Binary search to find the minimum time
required for task completion.
Traverse to find the lowest common
ancestor in a BST.
Implement and return the result of a
3
sorting algorithm.
Merge two sorted arrays into one in-
place.
Return the square of each number
sorted.

Sort an array with only 0s, 1s, and 2s.

Sort an array and return the maximum


difference between consecutive
elements.
Sort array and maximize the sum of min 3
elements in pairs.

Sort integers by number of set bits.

Count the number of swaps required


using bubble sort.
Insert the last element into its sorted
position using insertion sort.
Perform insertion sort and print steps.
Implement partition logic in quicksort.
3
Implement the first step of counting sort 3
– frequency count.
Sort the array and find the maximum
number of items that can be bought with
a budget.

Search for a given value in a BST and


return the subtree rooted with that node.

Insert a value into a BST and return the


root of the modified tree.
Delete a node with a given key from a
3
BST and return its root.

Determine if a binary tree is a valid BST.

Return the minimum absolute difference


between any two nodes in a BST.

Insert a node into a BST.

Search for a given key in a BST.

Calculate the height of a BST. 3

Find the lowest common ancestor (LCA)


of two nodes in a BST.

Determine if a binary tree is a BST.

Basics (1daysX3hrs) 3hrs


Arrays(5daysX3hrs) 15hrs
Strings(5daysX3hrs) 15hrs
Stacks(5daysX3hrs) 15hrs
Queues(2daysX3hrs) 6hrs
LinkedLists(5daysX3hrs) 15hrs
Searchings&Sortings(5daysX3hrs) 15hrs
BinarySearchTrees(2daysX3hrs) 6hrs
Total 90hrs
DSA Medium Level_90hrs
Days Topic Questions

LeetCode #73 – Set Matrix Zeroes

LeetCode #48 – Rotate Image

Day-1 Arrays LeetCode #238 – Product of Array


Except Self

LeetCode #56 – Merge Intervals

LeetCode #15 – 3Sum

LeetCode #16 – 3Sum Closest

LeetCode #33 – Search in Rotated


Sorted Array
LeetCode #34 – Find First and Last
Day-2 Arrays
Position of Element in Sorted Array

LeetCode #289 – Game of Life

LeetCode #128 – Longest Consecutive


Sequence
LeetCode #75 – Sort Colors (Dutch
National Flag Problem)
LeetCode #380 – Insert Delete
GetRandom O(1)
LeetCode #347 – Top K Frequent
Day-3 Arrays Elements

HackerRank #Array Manipulation

HackerRank #New Year Chaos

HackerRank #Minimum Swaps 2


HackerRank #Left Rotation
HackerRank #Dynamic Array
Day-4 Arrays
HackerRank #The Array Partition Game

HackerRank #Maximum Element

HackerRank #Grading Students

HackerRank #Median Updates

Day-5 Arrays
Day-5 Arrays HackerRank #AND XOR OR

HackerRank #Waiter

HackerRank #Subarray Division 2

LeetCode #3 – Longest Substring


Without Repeating Characters

LeetCode #6 – Zigzag Conversion

Day-6 Strings LeetCode #8 – String to Integer (atoi)

LeetCode #12 – Integer to Roman

LeetCode #17 – Letter Combinations of


a Phone Number

LeetCode #22 – Generate Parentheses

LeetCode #43 – Multiply Strings


Day-7 Strings LeetCode #49 – Group Anagrams
LeetCode #151 – Reverse Words in a
String

LeetCode #227 – Basic Calculator II

LeetCode #316 – Remove Duplicate


Letters

LeetCode #424 – Longest Repeating


Character Replacement

Day-8 Strings
LeetCode #567 – Permutation in String

HackerRank #Strong Password

HackerRank #Sherlock and Anagrams

HackerRank #The Love-Letter Mystery

HackerRank #Two Characters


Day-9 Strings
HackerRank #Alternating Characters

HackerRank #Super Reduced String

HackerRank #Funny String

HackerRank #Pangrams

Day-10 Strings
HackerRank #Anagram

Day-10 Strings
HackerRank #Gemstones

HackerRank #Separate the Numbers

HackerRank #Beautiful Binary String

LeetCode #2 – Add Two Numbers

LeetCode #19 – Remove N-th Node


From End of List
Day-11 LinkedLists
LeetCode #24 – Swap Nodes in Pairs
LeetCode #61 – Rotate List
LeetCode #82 – Remove Duplicates
from Sorted List II

LeetCode #86 – Partition List

LeetCode #92 – Reverse Linked List II

LeetCode #109 – Convert Sorted List to


Day-12 LinkedLists
Binary Search Tree

LeetCode #142 – Linked List Cycle II

LeetCode #143 – Reorder List


LeetCode #147 – Insertion Sort List
LeetCode #148 – Sort List

LeetCode #160 – Intersection of Two


Day-13 LinkedLists Linked Lists

HackerRank #Detect a Cycle

HackerRank #Merge Two Sorted Linked


Lists
HackerRank #Get the Value of a Node
at a Specific Position from Tail

HackerRank #Delete a Node

HackerRank #Insert a Node at a Specific


Day-14 LinkedLists
Position
HackerRank #Reverse a Doubly Linked
List
HackerRank #Sorted Insert (Doubly
Linked List)

HackerRank #Compare Two Linked Lists

HackerRank #Find Merge Point of Two


Lists

Day-15 LinkedLists
Day-15 LinkedLists HackerRank #Reverse Print

HackerRank #Delete Duplicate-Value


Nodes from a Sorted List
HackerRank #Inserting a Node into a
Sorted Doubly Linked List
LeetCode #784 – Letter Case
Permutation

LeetCode #401 – Binary Watch

Day-16 Backtracking LeetCode #526 – Beautiful Arrangement

LeetCode #93 – Restore IP Addresses

LeetCode #1087 – Brace Expansion

HackerRank #Backtracking: Subset Sum

HackerRank #Backtracking: Word


Search in Matrix
HackerRank #Backtracking: Rat in a
Day-17 Backtracking
Maze
HackerRank #Backtracking: N-Knight
Problem (Small N)
HackerRank #Backtracking: Print All
Permutations

LeetCode #455 – Assign Cookies

LeetCode #122 – Best Time to Buy and


Sell Stock II

LeetCode #392 – Is Subsequence


Day-18 Greedy Algorithm

LeetCode #944 – Delete Columns to


Make Sorted

LeetCode #134 – Gas Station

LeetCode #860 – Lemonade Change

LeetCode #1005 – Maximize Sum After


K Negations

Day-19 Greedy Algorithm LeetCode #1046 – Last Stone Weight

LeetCode #409 – Longest Palindrome

LeetCode #581 – Shortest Unsorted


Continuous Subarray
LeetCode #435 – Non-overlapping
Intervals

LeetCode #406 – Queue Reconstruction


by Height
Day-20 Greedy Algorithm LeetCode #452 – Minimum Number of
Arrows to Burst Balloons
LeetCode #861 – Score After Flipping
Matrix

LeetCode #763 – Partition Labels

LeetCode #1343 – Number of Sub-


arrays of Size K and Average Greater
than Threshold

LeetCode #135 – Candy


Day-21 Greedy Algorithm
LeetCode #621 – Task Scheduler

LeetCode #881 – Boats to Save People

LeetCode #630 – Course Schedule III

HackeRank #Greedy Florist

HackeRank #Luck Balance

Day-22 Greedy Algorithm


HackeRank #Mark and Toys

HackeRank #Max Min

HackeRank #Minimum Absolute


Difference in an Array

LeetCode #70 – Climbing Stairs


LeetCode #198 – House Robber
LeetCode #746 – Min Cost Climbing
Day-23 Dynamic Programming Stairs
LeetCode #121 – Best Time to Buy and
Sell Stock
LeetCode #303 – Range Sum Query -
Immutable

LeetCode #392 – Is Subsequence

LeetCode #1137 – N-th Tribonacci


Number
LeetCode #5 – Longest Palindromic
Day-24 Dynamic Programming
Substring

LeetCode #91 – Decode Ways


Day-24 Dynamic Programming

LeetCode #322 – Coin Change

LeetCode #300 – Longest Increasing


Subsequence
LeetCode #309 – Best Time to Buy and
Sell Stock with Cooldown
LeetCode #152 – Maximum Product
Day-25 Dynamic Programming
Subarray

LeetCode #279 – Perfect Squares

LeetCode #1143 – Longest Common


Subsequence

LeetCode #213 – House Robber II

LeetCode #62 – Unique Paths

Day-26 Dynamic Programming LeetCode #63 – Unique Paths II

LeetCode #96 – Unique Binary Search


Trees

HackerRank #The Coin Change Problem

HackerRank #Fibonacci Modified

HackerRank #Max Array Sum

Day-27 Dynamic Programming HackerRank #Candies

HackerRank #Abbreviation

HackerRank #Davis' Staircase

LeetCode #997 – Find the Town Judge

LeetCode #841 – Keys and Rooms

LeetCode #200 – Number of Islands


Day-28 Graphs
LeetCode #1971 – Find if Path Exists in
Graph

LeetCode #323 – Number of Connected


Components in an Undirected Graph

LeetCode #695 – Max Area of Island

LeetCode #261 – Graph Valid Tree

HackerRank #Breadth First Search:


Day-29 Graphs
Shortest Reach
HackerRank #DFS: Connected Cell in a
Grid
Day-29 Graphs

HackerRank #Roads and Libraries

HackerRank #Journey to the Moon

HackerRank #Components in a Graph

Day-30 Graphs HackerRank #Even Tree

HackerRank #BFS: Maze Escape

HackerRank #Prim’s (MST) Special


Subtree
el_90hrs
Description DurationHrs)

Modify the matrix such that if an element


is 0, its row and column are set to 0.

Rotate an n x n 2D matrix 90 degrees


clockwise in-place.
Return an array where each element is 3
the product of all other elements without
using division.
Merge all overlapping intervals in an
array.
Find all unique triplets in the array that
give the sum of zero.
Find the sum of three integers closest to
a target.
Search for an element in a rotated
sorted array.
Use binary search to find the starting
3
and ending positions.
Implement the Game of Life board
update rules in-place.
Return the length of the longest
consecutive elements sequence.

Sort array of 0s, 1s, and 2s.

Design a data structure supporting


insert, delete, and getRandom in O(1).

Return the k most frequent elements.


3
Perform range updates and return the
maximum value in the array after all
operations.
Determine the minimum number of
bribes that occurred in a queue.
Find the minimum number of swaps
required to sort an array.
Perform d left rotations on an array.
Implement a dynamic 2D array based on
queries.
3
Partition an array into two based on
conditions and calculate values
accordingly.
Implement a stack that supports finding
the maximum element.
Round grades to the nearest multiple of
5 according to specific rules.
Insert numbers in a stream and return
the median after each insertion (uses
heaps).

3
Determine the maximum value from a
specific bitwise expression between 3
pairs.
Simulate a stack of plates using prime
numbers and arrays.
Count the number of subarrays that sum
to a given value using sliding window
logic.
Find the length of the longest substring
without repeating characters.
Convert a string into a zigzag pattern on
a given number of rows.
Implement atoi to convert a string to an
3
integer.

Convert an integer to a Roman numeral.

Return all letter combinations from a


string of digits.
Generate all valid combinations of n
pairs of parentheses.
Multiply two non-negative numbers
represented as strings.
Group a list of strings into anagrams. 3
Reverse the words in a sentence,
removing extra spaces.
Evaluate a simple math expression with
+, –, *, and /.
Remove duplicate letters to get the
smallest lexicographical order.
Find the length of the longest substring
that can be obtained by replacing
characters.
3
Check if s2 contains a permutation of s1.

Determine the number of characters


needed to make the password strong.
Count the number of unordered
anagrammatic pairs of substrings.

Find the minimum number of operations


to make a string palindrome.

Delete characters to create a string of


two alternating characters.
Count deletions needed to make a string 3
of alternating characters.
Reduce the string by deleting pairs of
adjacent matching characters.
Determine whether the string is "funny"
based on ASCII differences.
Check if a sentence contains every letter
of the alphabet.

3
Determine the minimum number of
character changes to make two halves
an anagram.
Count elements that are common across 3
all strings.
Determine if a string can be split into a
sequence of consecutive numbers.
Count the number of operations to
eliminate the "010" pattern.
Add two numbers represented by linked
lists (digits in reverse order).
Remove the n-th node from the end of a
list in one pass.
Swap every two adjacent nodes in a 3
linked list.
Rotate the list to the right by k places.
Remove all duplicates such that only
distinct elements remain.
Partition list around a value x such that
nodes < x come before nodes ≥ x.
Reverse a portion of a list between
positions left and right.
Convert a sorted linked list to a height-
3
balanced BST.
Detect the node where the cycle begins
in a linked list.
Reorder a linked list in the form: L0 →
Ln → L1 → Ln-1 → ...
Sort a linked list using insertion sort.
Sort a linked list in O(n log n) time using
merge sort.
Find the intersection node of two linked
lists. 3
Determine whether a linked list contains
a cycle.
Merge two sorted linked lists into one
sorted list.
Return the value of the node at a given
position from the end.
Delete a node at a given position in a
linked list.
Insert a node at a specific index in the
3
list.

Reverse the order of a doubly linked list.

Insert a node into a sorted doubly linked


list maintaining sort order.

Check if two linked lists are identical.

Find the node where two linked lists


merge.

3
Print the elements of a linked list in
3
reverse order.
Remove duplicates from a sorted singly
linked list.
Insert a node in its correct position into a
sorted doubly linked list.
Given a string, return all permutations
with lowercase and uppercase letters.
Return all possible times a binary watch
could represent given a number of LEDs
that are on.
Count how many beautiful arrangements
exist where the number at index i is 3
divisible by i or vice versa.
Return all possible valid IP address
combinations from a string.
Expand a string with nested braces into
all possible combinations (e.g.,
{a,b}c{d,e} → acd, ace, etc.).
Find all subsets of an array that sum up
to a given target.
Check if a word exists in a 2D character
grid (backtracking DFS).
Print all possible paths for a rat to reach
3
the destination in a grid maze.
Place N knights on an NxN board such
that no two attack each other.
Generate all permutations of a given
string or array.
Assign cookies to children to maximize
contentment.
Maximize profit by buying/selling stock
multiple times.
Check if one string is a subsequence of
another. 3
Delete the minimum number of columns
to ensure each row is lexicographically
sorted.
Return the starting gas station index to
complete the circuit.
Determine if you can provide correct
change to every customer.
Flip the signs of elements up to K times
to maximize sum.
Smash two largest stones together and
3
return the last stone’s weight.
Build the longest palindrome that can be
made from letter counts.
Find the shortest subarray that, when
sorted, makes the whole array sorted.
Find the minimum number of intervals
you need to remove to make the rest
non-overlapping.
Reconstruct a queue from pairs of height
and position.
Find the minimum arrows to burst all 3
balloons represented as intervals.
Maximize matrix score by flipping
rows/columns.
Partition a string into parts such that
each letter appears in at most one part.

Find count of subarrays of size k with


average ≥ threshold.

Distribute candies such that each child


with a higher rating gets more candy
than neighbors.
3
Schedule tasks with cooldowns to
minimize total time.
Minimum number of boats to carry
people with given weight limits.
Maximize the number of courses taken
within their deadlines.
Minimize total cost of flowers by
choosing the purchase order wisely.
Lose some contests to maximize luck
balance, constrained by important
contests.
Buy the maximum number of toys within 3
a given budget.
Minimize the unfairness (max - min) in
selected array elements.
Minimize the absolute difference
between any two elements.
Count the distinct ways to climb stairs
taking 1 or 2 steps.
Max sum of non-adjacent elements.
Reach the top with the minimum cost
starting from step 0 or 1. 3
Maximize profit with a single buy/sell.

Precompute prefix sums to quickly


answer range queries.
Check if one string is a subsequence of
another using DP.

Generalization of Fibonacci sequence.

Find the longest substring which is a


3
palindrome.
Count the number of ways to decode a
string of digits.
3

Minimum coins to make a given amount.

Return the length of the longest


increasing subsequence.
Stock trading with a cooldown between
transactions.
Find the contiguous subarray with the
3
largest product.
Find the least number of perfect square
numbers that sum to n.

Find LCS of two strings using 2D DP.

Like House Robber, but houses are


arranged in a circle.
Count the number of paths from top-left
to bottom-right in a grid.
Grid with obstacles – count paths
3
avoiding blocked cells.
Count structurally unique BSTs storing
values 1...n.
Count the number of ways to make
change.
Generate modified Fibonacci with the
rule: t(n) = t(n-2) + (t(n-1))².
Maximum sum of non-adjacent elements
(similar to House Robber).
Distribute minimum candies to children
3
following rating rules.
Check if you can convert string A to B by
deleting or capitalizing characters.
Count the number of ways to climb stairs
taking 1, 2, or 3 steps.
Identify the town judge using trust
relationships.
Use DFS/BFS to determine if all rooms
can be visited.
Count connected components (islands)
using BFS/DFS. 3
Check if a path exists between two
nodes using DFS/BFS.

Count how many connected components


are in a graph.

Find the largest area of an island


(connected 1's) in a grid.
Check if a given undirected graph is a
valid tree.
Use BFS to find the shortest reach from
3
a starting node.
Use DFS to find the largest region in a
binary grid.
3

Build roads or libraries to connect all


cities at minimum cost.
Count valid astronaut pairs from different
countries using DFS.
Find the size of the smallest and largest
connected components.
Count edges that can be removed to
3
form even-sized subtrees.
Use BFS to find the shortest path to exit
a maze.
Find Minimum Spanning Tree using
Prim's algorithm.
Arrays(5daysX3hrs) 15hrs
Strings(5daysX3hrs) 15hrs
LinkedLists(5daysX3hrs) 15hrs
Backtracking(2daysX3hrs) 6hrs
Greedy Algorithm(5daysX3hrs) 15hrs
Dynamic Programming(5daysX3hrs) 15hrs
Graphs(3daysX3hrs) 9hrs
Total 90hrs
DSA High Level_90hrs
Days Topic Questions
LeetCode #4 – Median of Two Sorted
Arrays

LeetCode #41 – First Missing Positive

Day-1 Arrays LeetCode #84 – Largest Rectangle in


Histogram
LeetCode #239 – Sliding Window
Maximum
LeetCode #2971 – Find Polygon With
the Largest Perimeter

LeetCode #42 – Trapping Rain Water

LeetCode #315 – Count of Smaller


Numbers After Self

Day-2 Arrays
LeetCode #327 – Count of Range Sum

LeetCode #1289 – Minimum Falling Path


Sum II

LeetCode #2386 – Find the K-Sum of an


Array
LeetCode #10 – Regular Expression
Matching

LeetCode #44 – Wildcard Matching

Day-3 Strings LeetCode #68 – Text Justification

LeetCode #65 – Valid Number

LeetCode #472 – Concatenated Words

HackerRank – Special Palindrome Again

HackerRank – Two Strings Game

Day-4 Strings
HackerRank – Weighted Uniform Strings

CodeChef – PALLIND (Palindromic


Characteristics)
CodeChef – CHEFPAL

HackerRank -- Matrix Layer Rotation

HackerRank -- Connected Cells in a Grid

Day-5 2D Arrays CodeChef – MATRIX

CodeChef – CHEFSTR1

LeetCode #73 – Set Matrix Zeroes

LeetCode #48 – Rotate Image

LeetCode #240 – Search a 2D Matrix II

LeetCode #54 – Spiral Matrix


Day-6 2D Arrays

LeetCode #36 – Valid Sudoku

HackerRank -- 2D Array - DS (Hourglass


Sum)

LeetCode #37 – Sudoku Solver

LeetCode #51 – N-Queens

Day-7 Backtracking LeetCode #52 – N-Queens II

LeetCode #212 – Word Search II

LeetCode #60 – Permutation Sequence

LeetCode #301 – Remove Invalid


Parentheses
LeetCode #282 – Expression Add
Operators

Day-8 Backtracking LeetCode #140 – Word Break II

LeetCode #126 – Word Ladder II

LeetCode #980 – Unique Paths III

LeetCode #996 – Number of Squareful


Arrays

LeetCode #691 – Stickers to Spell Word

LeetCode #1293 – Shortest Path in a


Day-9 Backtracking
Grid with Obstacles Elimination
LeetCode #698 – Partition to K Equal
Sum Subsets
Day-9 Backtracking

LeetCode #473 – Matchsticks to Square

HackerRank – Backtracking: Knight’s


Tour
HackerRank – Backtracking: Crossword
Puzzle Solver
HackerRank – Backtracking: Rat in a
Day-10 Backtracking
Maze with Multiple Jumps
HackerRank – Backtracking: Tug of War
Partition
HackerRank – Backtracking: Sudoku
Solver (Extended Version)

CodeChef – CNOTE

CodeChef – CHEFGR

Day-11 Backtracking
CodeChef – ARRGAME

CodeChef – HARDP

CodeChef – GRIDWALK

LeetCode #135 – Candy

LeetCode #406 – Queue Reconstruction


by Height
LeetCode #452 – Minimum Number of
Day-12 Greedy
Arrows to Burst Balloons

LeetCode #621 – Task Scheduler

LeetCode #630 – Course Schedule III

LeetCode #871 – Minimum Number of


Refueling Stops
LeetCode #857 – Minimum Cost to Hire
K Workers

LeetCode #1057 – Campus Bikes


Day-13 Greedy

LeetCode #1326 – Minimum Number of


Taps to Open to Water a Garden

LeetCode #2141 – Maximum Running


Time of N Computers

LeetCode #1229 – Meeting Scheduler

LeetCode #1383 – Maximum


Performance of a Team

LeetCode #1589 – Maximum Sum


Day-14 Greedy
Obtained of Any Permutation
Day-14 Greedy

HackerRank – Luck Balance

HackerRank – Greedy Florist

HackerRank – Min Max Riddle

HackerRank – Jim and the Orders

HackerRank – Grid Challenge


Day-15 Greedy
HackerRank – Maximum Perimeter
Triangle

HackerRank – Sherlock and The Beast

CodeChef – TANDJ1

CodeChef – STFOOD

Day-16 Greedy CodeChef – CHEFSTUD

CodeChef – FRUITS

CodeChef – MAKEDIV3

LeetCode #124 – Binary Tree Maximum


Path Sum

LeetCode #297 – Serialize and


Deserialize Binary Tree

Day-17 Binary Trees


LeetCode #968 – Binary Tree Cameras

LeetCode #968 – Smallest Subtree with


all the Deepest Nodes

LeetCode #1339 – Maximum Product of


Splitted Binary Tree

LeetCode #742 – Closest Leaf in a


Binary Tree

LeetCode #2246 – Longest Path with


Different Adjacent Characters

LeetCode #879 – Profitable Schemes


Day-18 Binary Trees (Tree DP logic applied on constraints)
HackerRank – Tree: Is This a Binary
Search Tree? (Advanced constraints
validation)
Day-18 Binary Trees

CodeChef – BTAPATH

LeetCode #99 – Recover Binary Search


Tree

LeetCode #510 – Inorder Successor in


BST II

Day-19 Binary Search Trees LeetCode #270 – Closest Binary Search


Tree Value (With Follow-Up)
LeetCode #1644 – Lowest Common
Ancestor of a Binary Tree II
LeetCode #1642 – Furthest Building You
Can Reach (Tree-based binary search
strategy)

LeetCode #1382 – Balance a Binary


Search Tree

LeetCode #352 – Data Stream as


Disjoint Intervals

LeetCode #863 – All Nodes Distance K


Day-20 Binary Search Trees
in Binary Tree

LeetCode #230 – Kth Smallest Element


in a BST (Follow-up for constant space)

LeetCode #510 – Inorder Successor in


BST II

LeetCode #440 – K-th Smallest in


Lexicographical Order

LeetCode #1325 – Delete Leaves With a


Given Value

Day-21 Binary Search Trees LeetCode #233 – Number of Digit One

HackerRank – Self Balancing Tree: AVL


Tree Insertion

CodeChef – BSTOPS

LeetCode #295 – Find Median from Data


Stream

LeetCode #218 – The Skyline Problem

Day-22 Heaps & Hashing LeetCode #239 – Sliding Window


Maximum
LeetCode #2398 – Maximum Number of
Robots Within Budget
Day-22 Heaps & Hashing

LeetCode #358 – Rearrange String k


Distance Apart

LeetCode #480 – Sliding Window


Median

LeetCode #1057 – Campus Bikes

LeetCode #895 – Maximum Frequency


Day-23 Heaps & Hashing
Stack

LeetCode #432 – All O`one Data


Structure

LeetCode #871 – Minimum Number of


Refueling Stops
LeetCode #1235 – Maximum Profit in
Job Scheduling
LeetCode #2397 – Maximum Rows
Covered by Columns
LeetCode #1438 – Longest Continuous
Day-24 Heaps & Hashing
Subarray with Absolute Diff ≤ Limit

LeetCode #767 – Reorganize String

LeetCode #373 – Find K Pairs with


Smallest Sums

HackerRank – Jesse and Cookies

HackerRank – QHEAP1 (Query Heap)

Day-25 Heaps & Hashing HackerRank – Frequency Queries

HackerRank – Median Updates

HackerRank – Find the Running Median

CodeChef – FREQARR

CodeChef – CHEFEXAM

CodeChef – HEAPEX
Day-26 Heaps & Hashing

CodeChef – MEXSUB

CodeChef – ICM2009 (Custom heap


structure)

LeetCode #269 – Alien Dictionary

Day-27 Graphs
LeetCode #332 – Reconstruct Itinerary

Day-27 Graphs
LeetCode #847 – Shortest Path Visiting
All Nodes
LeetCode #1192 – Critical Connections
in a Network

LeetCode #787 – Cheapest Flights


Within K Stops

LeetCode #1129 – Shortest Path with


Alternating Colors

LeetCode #1462 – Course Schedule IV

Day-28 Graphs
LeetCode #815 – Bus Routes

HackerRank – Matrix (Difficulty: Hard)

CodeChef – REBXOR

LeetCode #44 – Wildcard Matching

LeetCode #312 – Burst Balloons

LeetCode #10 – Regular Expression


Day-29 DP
Matching

LeetCode #72 – Edit Distance

LeetCode #132 – Palindrome


Partitioning II
LeetCode #1326 – Minimum Number of
Taps to Open to Water a Garden

LeetCode #879 – Profitable Schemes

LeetCode #514 – Freedom Trail


Day-30 DP

HackerRank – Candies
Day-30 DP

CodeChef – TWOFL
_90hrs
Description DurationHrs)
Find the median of two sorted arrays in
O(log(min(m,n))) time.

Find the smallest missing positive


integer in O(n) time and constant space.

Find the area of the largest rectangle in 3


a histogram (Stack + Array).
Find the maximum value in each sliding
window of size k (Deque).
From an array, find a polygon (subset)
that forms the largest valid perimeter.
Calculate how much water can be
trapped between elevations (Two
pointers or Stack).
Return the count of smaller elements to
the right of each element (Merge sort
variant).
Count the number of range sums that lie 3
in a given inclusive interval (Prefix Sum
+ Merge Sort).
Find the minimum falling path sum with
the condition that no two elements come
from the same column.
Return the k-th largest sum of a non-
empty subsequence.
Implement regex matching with support
for '.' and '*' using DP.
Implement wildcard matching where ?
matches a single char and * matches
any sequence.
Format a list of words into fully justified
3
text with even spacing.
Validate whether a given string is a valid
decimal number.
Given a list of words, return all words
that are formed by concatenating at least
two other words in the list.
Count all special palindromic substrings
in a string, including those where all
characters are same or all except the
middle one.

Two players alternately delete a


character from either end – who will win?

Given a string and queries, check if a 3


given weight can be achieved by a
uniform substring.
Count how many substrings of a given
string are palindromes and compute
their "palindromic characteristics".
Given a string, split it into two
palindromic parts with maximum length.
Rotate the outer layers of a matrix
independently.
Use DFS/BFS to count the largest region
of connected 1s.
Given a 2D matrix, check for a condition
3
or perform simple queries.
Based on sequences in rows/columns,
calculate the number of transitions.
Set entire row and column to zero if an
element is zero, in-place.
Rotate a square matrix 90 degrees
clockwise in-place.
Search for a target in a 2D matrix where
rows and columns are sorted.
Return all elements in spiral order from a
2D matrix. 3
Check if a 9x9 Sudoku board is valid
with row, column, and sub-box
constraints.
Calculate the maximum hourglass sum
in a 6x6 matrix.
Solve a partially filled 9x9 Sudoku board
using backtracking.
Return all distinct solutions to the N-
Queens problem.
Count the total number of distinct
3
solutions to the N-Queens puzzle.
Find all words from a list in a 2D board
(Trie + Backtracking).
Find the k-th permutation of the numbers
1 to n.
Remove the minimum number of invalid
parentheses to make the string valid.
Add operators (+, -, *) between digits to
reach the target value.
Return all valid sentences by breaking a
3
string using a dictionary.
Return all shortest transformation
sequences (BFS + backtracking).
Find all unique paths from start to end
visiting each cell exactly once.
Count permutations where adjacent
pairs sum to a perfect square.
Find the minimum number of stickers to
spell a word.
Find the shortest path while eliminating
3
limited obstacles.
Can you partition an array into k subsets
with equal sum?
3

Form a square using matchsticks with


equal-length sides.
Find a path that visits every cell exactly
once using a knight’s move.
Fill in a crossword puzzle with given
words using backtracking.
The rat can jump multiple steps in
3
allowed directions – find all paths.
Partition a set into two subsets with
minimum sum difference.
Solve harder Sudoku variants (diagonal,
16x16).
Choose the best notebook using
constraint checks.
Distribute extra chocolates to make
heights equal (decision-making
recursion).
Recursively simulate a game based on 3
array positions.
Solve a constrained password problem
using recursive backtracking.
Count the number of valid paths in a grid
with boundary constraints.
Distribute minimum candies to children
based on ratings (Two-pass greedy).
Reconstruct a queue using height and
position pairs.
Burst all balloons (interval merging
3
logic).
Schedule tasks with cooldowns to
minimize total time.
validate whether a given string is a valid
decimal number.
Reach the target using minimum fuel
stops (Greedy + Heap).
Hire k workers minimizing cost while
maintaining ratio constraints.
Assign bikes to workers based on the
shortest Manhattan distance (Sorting +
Priority Queue). 3

Choose the minimum number of taps to


cover the garden (Greedy interval
coverage).
Distribute batteries among computers to
maximize simultaneous runtime.
Find the earliest time slot that works for
both people (Two-pointer + sorting).
Maximize team performance based on
speed and efficiency constraints.
Rearrange array elements to maximize
weighted sum based on query 3
frequency.
3

Choose which contests to lose to


maximize total luck.
Buy all flowers at minimum cost under
increasing pricing logic.
For every window size, find max of the
minimums (Stack + Greedy logic).
Schedule customers by their order
completion time.
Determine if rows/columns can be
rearranged lexicographically. 3
Choose 3 sticks to form a triangle with
max perimeter (greedy sort logic).
Construct largest decent number
consisting of 5s and 3s only (modulo-
based greed).
Find the earliest meeting point between
two moving entities on a grid (parity trick
+ greedy check).
Choose the shop that gives the max
profit per food unit.
Count the minimum movements required
in a sequence of students to achieve an 3
arrangement.
Transfer fruits to equalize baskets
(greedy minimum difference).

Form the smallest number divisible by 3


using specific constraints (digit greed).

Find the path with the maximum sum in


a binary tree (can start and end at any
node).
Design an algorithm to encode and
decode a binary tree to/from a single
string.
Place the minimum number of cameras 3
to monitor all nodes in a binary tree.
Find the smallest subtree containing all
the deepest nodes.

Delete one edge to split a tree into two


and maximize the product of their sums.

Find the closest leaf node to a target


value in a binary tree.

In a tree with characters, find the longest


path such that adjacent nodes differ.

Solve using advanced tree-style DP


thinking with constraints. 3

Validate BST properties recursively for


large trees.
3

Find the longest valid path or maximum


weighted path in a binary tree
represented as input pairs.
Recover a BST where two nodes are
swapped by mistake (in-order violation
correction).
Find the in-order successor of a given
node in a BST where nodes have parent
pointers.
Find the k values in BST that are closest 3
to the target.
Find LCA even if one or both nodes
might not exist in the tree.

Reach the furthest building using binary


search + greedy.

Given an unbalanced BST, return a


balanced one (in-order + divide and
conquer).
Maintain disjoint intervals from a data
stream using BST logic.
Return all nodes at distance K from a
target node (requires parent references, 3
DFS + BFS hybrid).
Return k-th smallest using O(1) space
(Morris Traversal – advanced in-order
technique).
In-order successor using parent pointers
and structural recursion.

Use implicit BST structure over numbers


(tree-style traversal by prefix count).

Recursively delete leaf nodes with a


specific value, pruning the tree.
Count how many times digit '1' appears
– solved using digit-position-aware 3
recursion (tree-based pattern).
Implement AVL tree with rotation logic to
keep the tree balanced.
Perform a sequence of BST insert/delete
operations and find the longest path in
the resulting BST.
Maintain a running median using two
heaps (min/max).
Use a max heap to determine the
changing skyline from building
coordinates.
Maintain max in a sliding window using 3
deque or heap with lazy deletion.
Use sliding window + max heap to
control budget.
3

Use a heap + hash map to rearrange


characters maintaining distance k.
Maintain two heaps with lazy deletion to
return the median in each sliding
window.
Assign bikes to workers using priority
queues based on distance.
Stack with frequency tracking and max
3
heap of frequencies.
Design a structure to get max and min
key with O(1) time using HashMap +
DoubleLinkedList.
Greedy + max heap for fuel stops
optimization.
Sort + binary search + heap to choose
non-overlapping jobs.
Use bit masking + hashing to maximize
covered rows.
Maintain max and min via TreeMap or
3
two heaps.
Rearrange characters so no two
adjacent are the same using heap.
Use heap to return k pairs with smallest
sum from two sorted arrays.
Use a min-heap to combine cookies until
a minimum sweetness is achieved.
Implement a min-heap with
insert/delete/getMin efficiently.
Use two hash maps to track values and
3
their frequencies.
Maintain running median using two
heaps.
Similar to Median Updates – track
medians on real-time input.
Check if frequency arrays can be made
equal with minimal swaps (Hashing +
freq map).
Track frequency constraints across
segments using hash sets.
Determine if array represents a valid
max/min heap. 3
Count subarrays based on MEX
(minimum excluded value) using hash
maps.
Priority queues to maintain custom
scoring and rankings with real-time
queries.

Given a sorted dictionary of an alien


language, derive the order of characters
(Topological Sort + Graph Construction).

3
Reconstruct an itinerary from a list of
airline tickets. Must use all tickets exactly
once (Hierholzer’s algorithm for Eulerian
Path).
3
Find the shortest path that visits every
node exactly once (Bitmask + BFS).
Find all bridges in a network (Tarjan’s
Algorithm).
Use modified Dijkstra or BFS with state
tracking to find the cheapest price from
source to destination with at most K
stops.

Shortest path with edge color constraints


(Graph + BFS + State Tracking).

Given prerequisite pairs and queries,


determine whether one course is a
prerequisite of another (Transitive
Closure via Floyd-Warshall or DFS
caching).
Find minimum buses required to travel 3
from source to target stop (Graph of bus
routes + BFS).
Grid-based graph traversal with
weighted edges; shortest path between
points with given move cost.
Find the maximum XOR of any subarray
using Trie + Graph logic or DP with
segment trees.
Use DP to implement pattern matching
with ? and *.
Use interval DP to maximize coins
earned by bursting balloons in an
optimal order.
Implement regex pattern matching with
3
support for . and *.
Compute the minimum number of
operations to convert one word to
another using 2D DP.
Use DP to find the minimum cuts
needed for a palindrome partitioning.
Convert the problem into interval
coverage using greedy + DP.
3D DP over members, profit, and group
constraints.
Rotate a ring to match a string in
minimum steps (circular DP with
memoization). 3

Distribute candies based on ratings


using two-pass DP.
3

2D DP with XOR values and path-based


decision-making to find max result.

Arrays(2daysX3hrs) 6hrs
Strings(2daysX3hrs) 6hrs
2D Arrays(2daysX3hrs) 6hrs
Backtracking(5daysX3hrs) 15hrs
Greedy(5daysX3hrs) 15hrs
BinaryTrees(2daysX3hrs) 6hrs
Binary Search Trees(3daysX3hrs) 9hrs
Heaps&Hashing(5daysX3hrs) 15hrs
Graphs(2daysX3hrs) 6hrs
DP(2daysX3hrs) 6hrs
Total 90hrs

You might also like