This repository contains solutions to Most Famous DSA questions, organized topic-wise with difficulty levels, solutions, and time complexity analysis.
- Arrays
- Maths
- Bit Manipulation
- Searching
- Recursion
- Backtracking
- Sorting
- Two Pointers
- Hashing
- String Algorithm
- Stacks
- Queues
- Linked List
- Trees
- Binary Search Tree (BST)
-
ARRAYS
S.no Question Difficulty Solution Time Complexity 1 Smaller & Greater 2 Elemnt having atleast 2 . element 3 Min picks 4 Pattern Printing 1 5 Inversion count in an Array 6 Max unsorted subArray 7 Array With consicutive element 8 Min abs diff 9 Reverse Pair 10 Largest Number 11 Sum the diff 12 Game of bottles 13 Max_min magic 14 Largest number 15 Max_mod 16 unique element 17 Max chunk to make sorted 18 Min swap 2 19 Count of smaller number after self 20 Reverse pairs 21 Inversion count in an Array 22 Pair sum divisible by M -
Math
S.no Question Difficulty Solution Time Complexity 1 Maximum height of staircase 2 A, B and Modulo 3 Very Large Power 4 Prime Modulo Inverse 5 Compute nCr % m -
Bit Manipulation
S.no Question Difficulty Solution Time Complexity 1 Reverse Bits 2 Single Number 3 Different Bits Sum Pairwise 4 Min XOR value 5 Single Number III 6 Divide Integers 7 Single Number II 8 Strange Equality 9 Interesting Array 10 Single Number 11 Single Number II 12 Number of 1 Bits 13 Reverse Bits 14 Count Total Set Bits -
Searching
S.no Question Difficulty Solution Time Complexity 1 Rotated Sorted Array Search 2 Sorted Insert Position 3 Single Element in a Sorted Array 4 Find a peak element 5 Matrix Search 6 Special Integer 7 Allocate Books 8 Painter's Partition Problem 9 Aggressive cows 10 Smallest Good Base 11 Special Integer 12 Ath Magical Number 13 Square Root of Integer 14 Painter's Partition Problem 15 Kth Smallest Element -
Recursion & Backtracking
S.no Question Difficulty Solution Time Complexity 1 Suduko 2 GrayCode Medium 3 Sixlets 4 AnotherSeqProp 5 LetterPhone 6 Number of squarefull array 7 Min swap to arrange pairs 8 Combination sum 9 Generate all paranthesis 10 N queens 11 Palindrome partitioning 12 Unique path 3 13 Combination Sum 2 14 Remove invalid paranthesis 15 Vertical & Horizontal sums -
Two Pointers
S.no Question Difficulty Solution Time Complexity 1 3 Sum 2 Container With Most Water 3 Another Count Rectangles 4 Subarray with given sum 5 Pairs with given sum II 6 Array 3 Pointers 7 Max Continuous Series of 1s 8 Count Subarrays 9 Closest pair from sorted arrays 10 Merge Two Sorted Arrays -
String Algorithm
S.no Question Difficulty Solution Time Complexity 1 Vowel it Medium - - -
STACKS
S.no Question Difficulty Solution Time Complexity 1 Min Stack Medium - - 2 Passing Game 3 Sort stack using another stack 4 Maximum Frequency stack Medium maintain list of stack with frequency O(n) 5 Redundant Braces Easy - - 6 Balanced Paranthesis 7 All Subarrays 8 Check two bracket expressions 9 EvaluateTheExpression 10 Largest Rectangle in Histogram 11 12 13 14 15 16 -
QUEUES
S.no Question Difficulty Solution Time Complexity 1 Sliding Window Maximum Medium - - -
LinkedList
S.no Question Difficulty Solution Time Complexity 1 K reverse linked list Medium - -