Skip to content

ishikagoyal02/SOLVE-DSA-WITH-ME

Repository files navigation


This repository serves as a collection of Data Structure and Algorithm (DSA) questions that I have solved. It is organized by different topics to help you navigate and practice specific problem sets. By solving these questions, I aim to strengthen my understanding of DSA concepts and improve my problem-solving skills..

Table of Contents

About

In this repository, you will find a variety of DSA questions that I have solved. Each question is categorized by its corresponding topic, and the solutions are provided in the respective folders. The goal is to provide a comprehensive resource for learning and practicing DSA concepts.

Topics

The repository covers a wide range of DSA topics, including but not limited to:

  1. Array
  2. String
  3. Recursion and Backtracking
  4. Bit Manipulation
  5. Binary Tree
  6. Sliding Window
  7. Stack
  8. Queue
  9. Heap
  10. Greedy Algorithm
  11. Dynamic Programming
  12. Binary Search
  13. Linked List
  14. Binary Search Tree
  15. Graph

Feel free to explore the repository and delve into the topics that interest you the most.

Daily DSA Practice

Welcome to my Daily DSA Practice repository! In this repository, I share my daily solved Data Structure and Algorithm (DSA) questions. Each day, I solve a new problem to improve my problem-solving skills and deepen my understanding of different algorithms and data structures.

Table of Contents

About

This repository contains a collection of DSA questions that I solve daily. Each question is organized in a separate folder, which includes the problem statement, my solution(s), and any additional resources used for reference or learning.

POTD (Problem of the Day)

Here is a list of daily solved DSA questions:

Day 1 (5 JUNE):

Day 2 (6 JUNE):

Day 3 (7 JUNE):

Day 4 (8 JUNE):

Day 5 (9 JUNE):

Day 6 (12 JUNE):

Day 7 (13 JUNE):

Day 8 (14 JUNE):

Day 9 (15 JUNE):

Day 10 (19 JUNE):

Day 11 (20 JUNE):

Day 12 (21 JUNE):

Day 13 (4 JULY):

Day 14 (5 JULY):

Day 15 (6 JULY):

Day 16 (7 JULY):

Day 17 (10 JULY):

Day 18 (17 JULY):

Day 19 (21 AUGUST):

Day 20 (22 AUGUST):

Day 21 (26 AUGUST):

Day 22 (30 AUGUST):

Day 23 (2 SEPTEMBER):

Day 24 (12 SEPTEMBER):

Day 25 (12 SEPTEMBER):

Day 26 (17 SEPTEMBER):

Day 27 (18 SEPTEMBER):

Day 28 (19 SEPTEMBER):

Day 29 (20 SEPTEMBER):

Day 30 (22 SEPTEMBER):

Day 31 (23 SEPTEMBER):

Day 32 (25 SEPTEMBER):

Day 33 (26 SEPTEMBER):

Day 34 (27 SEPTEMBER):

Day 35 (28 SEPTEMBER):

Day 36 (29 SEPTEMBER):

Day 37 (30 SEPTEMBER):

Day 38 (1 OCTOBER):

Day 39(3 OCTOBER)

DAY 40(4 OCTOBER)

Day 41(9 OCTOBER)

Day 42(12 OCTOBER)

Day 43(13 OCTOBER)

Day 44(14 OCTOBER)

Day 45(21 OCTOBER)

Day 46(23 OCTOBER)

Day 47(24 OCTOBER)

Day 48(25 OCTOBER)

Day 49(26 OCTOBER)

Day 50(2 NOV)

Day 51(3 NOV)

Day 52(4 NOV)

Day 53(5 NOV)

Day 55(7 NOV)

Day 56(8 NOV)

Day 57(9 NOV)

Day 58(10 NOV)

DAY 59(11 NOV)

DAY 60(17 NOV)

Day 61(18 NOV)

DAY 62(19 NOV)

DAY 63(20 NOV)

DAY 64(21 NOV)

DAY 65(22 NOV)

DAY 66(24 NOV)

DAY 67(25 NOV)

DAY 68(26 NOV)

DAY 69(29 NOV)

DAY 70(1 DEC)

DAY 71(2 DEC)

DAY 72(3 DEC)

DAY 73(4 DEC)

DAY 74(5 DEC)

DAY 75(6 DEC)

DAY 76(7 DEC)

DAY 77(9 DEC)

DAY 78(18 DEC)
-Maximum Product Difference Between Two Pairs (LEETCODE EASY)

DAY 78(27 DEC)
-Anti-Diagonal Traversal of Matrix (GFG MEDIUM) -Minimum Time to make rope colorful (LEETCODE MEDIUM)

DAY 79(29 DEC)
-Check if a string is repetition of its substring of k-length (GFG MEDIUM)

DAY 80(30 DEC)
-Winner of election (GFG EASY) -Redistribute Characters to Make All Strings Equal (LEETCODE EASY)

DAY 81(31 DEC)
-New Year Resolution (GFG Medium) -Largest string between two equal character (LEETCODE EASY)

DAY 82(1 JAN)

DAY 83(2 JAN)

DAY 84(3 JAN)

DAY 85(4 JAN)

DAY 86(10 JAN)

DAY 87(11 JAN)

DAY 88(12 JAN)

DAY 89(13 JAN)

DAY 90(14 JAN)

DAY 91(15 JAN)

DAY 92(16 JAN)

DAY 93(17 JAN)

DAY 94(18 JAN)

DAY 95(19 JAN)

DAY 96(20 JAN)

DAY 97(21 JAN)

DAY 98(22 JAN)

DAY 99(23 JAN)

DAY 100(24 JAN)

DAY 101(25 JAN)

DAY 102(26 JAN)

DAY 103(27 JAN)

DAY 104(30 JAN)

DAY 105(31 JAN)

DAY 106(1 FEB)

DAY 107(2 FEB)

DAY 108(3 FEB)

DAY 109(4 FEB)

DAY 110(5 FEB)

DAY 111(6 FEB)

DAY 112(7 FEB)

DAY 113(11 FEB)

DAY 114(12 FEB)

DAY 115(13 FEB)

DAY 116(14 FEB)

DAY 117(15 FEB)

DAY 118(16 FEB)

DAY 119(17 FEB)

DAY 120(18 FEB)

DAY 121(19 Feb)
-Game with String

DAY 122(27 FEB)

DAY 123(28 FEB)

DAY 124(29 FEB)

DAY 125(1 MARCH)

DAY 126(3 MARCH)

DAY 127(5 MARCH)

DAY 128(6 MARCH)

  • [Detect cycle in LL] (LEETCODE EASY)

DAY 129(7 MARCH)

DAY 130(9 MARCH)

DAY 131(10 MARCH)

DAY 132(11 MARCH)

DAY 133(13 MARCH)

DAY 134(14 MARCH)

DAY 135(15 MARCH)

DAY 136(20 MARCH)

DAY 137(31 MARCH)

DAY 138(2 APRIL)

DAY 139(3 APRIL)

DAY 140(31 MAY)

DAY 141(1 JUNE)

DAY 142(4 JUNE)

DAY 143(5 JUNE)

DAY 144(7 JUNE)

DAY 145(8 JUNE)

DAY 146(9 JUNE)

DAY 147(10 JUNE)

DAY 148(11 JUNE)

DAY 149(13 JUNE)

DAY 150(14 JUNE)

DAY 151(16 JUNE)

DAY 152(`0 July)

Feel free to explore the repository and review the solutions to each POTD question. If you have any questions or suggestions, don't hesitate to reach out. Happy coding!

ARRAY

  1. Plus One
  2. Set Matrix Zeroes
  3. Contains Duplicates
  4. Check if Array Is Sorted and Rotated
  5. Remove Duplicates from Sorted Array
  6. Remove Element
  7. Sum of Squares of Special Elements (16 July contest)
  8. Majority Element
  9. Majority Element 2
  10. Equilibrium Point
  11. Print First n Fibonacci Number
  12. Monotonic Array
  13. Find triplets with zero sum
  14. Boolean Matrix
  15. Boundary traversal of matrix
  16. Number Of Good Pair (LEETCODE Easy)
  17. Last Visited Integers (Leetcode Contest)
  18. Longest Unequal Adjacent Groups Subsequence I (Leetcode Contest)
  19. Find Indices With Index and Value Difference I (Leetcode Contest)
  20. Negative Prefix (GFG Contest)
  21. Pascal's Triangle II
  22. Form a number divisible by 3 using array digits
  23. Sum of upper and lower triangle (GFG Easy)
  24. Diagonal Traverse 2 (LEETCODE MEDIUM)
  25. Pascal Triangle (GFG EASY)
  26. Maximum Number of Coins You Can Get (LEETCODE MEDIUM)
  27. Largest Submatrix With Rearrangements (LEETCODE MEDIUM)
  28. Palindrome Number
  29. Minimum Time Visiting All points (LEETCODE EASY)
  30. Minimize the height 2 (GFG MEDIUM)
  31. Count of Matches in Tournament (LEETCODE EASY)
  32. Maximum Product Difference Between Two Pairs (LEETCODE EASY)
  33. Convert an Array into 2D array with conditions (LEETCODE MEDIUM)
  34. Longest subarray divisible by k (GFG MEDIUM)
  35. Find Players with zero or one losses (LEETCODE MEDIUM)
  36. Unique number of ocurrences (LEETCODE EASY)
  37. Top k numbers in a stream (GFG MEDIUM)
  38. Set Mismatch (LEETCODE EASY)
  39. Group Anagrams (LEETCODE MEDIUM)
  40. Reursive Sequence (GFG EASY)
  41. Find First Palindrome String in array (LEETCODE EASY)
  42. Rearrange Array Elements by Sign (LEETCODE MEDIUM)
  43. Find the Polgon with largest perimeter (LEETCODE MEDIUM)
  44. Peak Element (GFE MEDIUM)
  45. LargeSt Number formed by array (GFG MEDIUM)
  46. Minimum Common Value
  47. Intersection of two array (LEETCODE EASY)
  48. Product of array except self (LEETCODE MEDIUM)
  49. Swapping pairs make summ equal (GFG MEDIUM)
  50. Find Common Characters (LEETCODE EASY)
  51. Maximum Common Integer (GFG MEDIUM)
  52. Continuous Subarray Sum (LEETCODE MEDUM)
  53. Subarray Sums Divisible by K (LEETCODE MEDIUM)
  54. Convert array into Zig-Zag fashion (GFG EASY)
  55. Height Checker (LEETCODE EASY)
  56. Nuts and Bolts Problem (GFG MEDIUM)
  57. Relative Sort Array (LEEYCODE EASY)
  58. Prime Pair with Target Sum (GFG MEDIUM)

Recursion And Backtracking

  1. Height of Binary Tree
  2. Is Subsequence
  3. Power Of Numbers
  4. Sort Stack
  5. Reverse Stack
  6. Merge Sort
  7. Combination Sum
  8. Combination Sum2
  9. Combination Sum3
  10. Subset Sum
  11. Subset Sums2
  12. Generate all binary strings
  13. Generate Parenthesis
  14. Permutation with spaces
  15. Letter Combinations of a Phone number
  16. Permutation
  17. Permutation2
  18. Count Good Numbers
  19. Power Of Four
  20. K-th Symbol in Grammar
  21. Minimum Operation
  22. Print Pattern (GFG EASY)
  23. Implement Atoi (GFG MEDIUM)
  24. Armstrong Number (GFG EASY)

Bit Manipulation

  1. Swap Two Numbers
  2. XOR Operation
  3. Check whether K-th bit is set or not
  4. Power Of Four
  5. Number of 1 Bits (LEETCODE EASY)
  6. ODD/EVEN
  7. Power of 2
  8. Set the rightmost unset bit
  9. Bit Difference
  10. Single Number
  11. Play with OR (GFG EASY)
  12. Sum of bit difference (GFG MEDIUM)
  13. Swap two nibbles in a byte (GFG EASY)
  14. Single Number 3 (LEETCODE EASY)
  15. Binary representation of next number (GFG EASY)
  16. Construct list using given q XOR queries (GFG MEDIUM)

Binary Tree

  1. InOrder Traversal
  2. PreOrder Traversal
  3. PostOrder Traversal
  4. Level Order Traversal
  5. Maximum Height Of Tree
  6. Balanced Binary Tree
  7. Diameter of Binary Tree
  8. Maximum Path Sum
  9. Same Tree
  10. ZigZag Level Traversal
  11. Duplicate subtree in Binary Tree
  12. Floor in BST
  13. Find The Larget Value in Each Row
  14. Binary Tree to CDLL (GFG MEDIUM)
  15. K Sum Path (GFG MEDIUM) IMP
  16. Determine if Two Trees are identical (GFG EASY)
  17. Symmetric Tree (GFG EASY)
  18. Amount of time for binary tree to be infected (LEETCODE MEDIUM)
  19. Max Diff between node and ancestor (LEETCODE MEDIUM)
  20. Distribute Coins in a binary tree (GFG MEDIUM)
  21. Count the nodes at distance K from leaf (GFG MEDIUM)
  22. Min between 2 given nodes (GFG MEDIUM)
  23. Check for Children Sum Property in a Binary Tree (GFG MEDIUM)
  24. Find Bottom Left of tree (LEETCODE MEDIUM)
  25. Even Odd Tree (LEETCODE MEDIUM)

Sliding Window

  1. Maximum Sum of Distinct Subarrays With Length K

  2. First negative integer in every window of size k

  3. Find All Anagrams in a String

  4. Sliding Window Maximum

  5. Subarray Sum Equals K

  6. Longest K unique characters substring

  7. Longest Substring Without Repeating Characters

  8. Binary Subarrays With Sum

  9. Max Consecutive Ones III

  10. Number of Substrings Containing All Three Characters

  11. Subarray with given sum (1st subarray)

  12. Minimum Operation to Reduce X to zero

  13. Minimum Maximum Pair Sum in Array (LEETCODE MEDIUM)

  14. Largest Sum Subarray of size atleast k (GFG MEDIUM)

  15. Smallest Window Containing 0,1,2 (GFG MEDIUM)

  16. Count the number of incremovable subarrays 1

Stack

  1. Remove k digits (GFG MEDIUM)
  2. Implement queue using stack
  3. Evaluate Reverse Polish Notation (LEETCODE MEDIUM)
  4. Dailt Temperatures (LEETCODE MEDIUM)

Queue

  1. Reverse first k digits of queue (GFG EASY)

String

  1. Reconstruct Original Digits from English

  2. Reverse words in a given string (String separated by ".")

  3. Reverse words in a given string (String separated by " ")

  4. Anagram

  5. Non Repeating Character

  6. Remaining String

  7. Find the Difference

  8. Maximum Old Binary Number (Leetcode Contest)

  9. Last Visited Integers (Leetcode Contest)

  10. Number following a pattern (GFG MEDIUM)

  11. Check if String is rotated by 2 places (GFG EASY)

  12. Minimum Amount of Time to Collect Garbage (LEETCODE MEDIUM)

  13. 1662. Check If Two String Arrays are Equivalent (LEETCODE EASY)

  14. 1160. Find Words That Can Be Formed by Characters (LEETCODE EASY)

  15. Largest 3 Same Digit Number in String (LEETCODE EASY)

  16. How Many X's? (GFG MEDIUM)

  17. Largest Odd Number in String (LEETCODE EASY)

  18. Check if a string is repetition of its substring of k-length (GFG MEDIUM)

  19. -Largest string between two equal character (LEETCODE EASY)

  20. Number of laser beams in a bank (LEETCODE MEDIUM)

  21. Determine if string halves are alike (LEETCODE EASY)

  22. Minimum Number of Steps to Make Two Strings Anagram (LEETCODE EASY)

  23. Find duplicate rows in a binary matrix

  24. Determine if Two Strings Are Close

  25. Longest Common Subsequence of 3 string (GFG MEDIUM)

  26. Pangram Check (GFG EASY)

  27. First Unique Character in a String (LEETCODE EASY)

  28. Check String is divisble by 8 (GFG EASY)

  29. Max Odd Binary Number (LEETCODE EASY)

  30. Minimum Length of string after deleting similar ends (LEETCODE MEDIUM)

  31. Remove all duplicates from a given string (GFG EASY)

  32. Custom Sort String (LEETCODE MEDIUM)

  33. Isomorphic Strings (LEETCODE EASY)

  34. Odd Even Problem (GFG EASY)

  35. Append Characters to String to Make Subsequence (LEETCODE MEDIUM)

  36. Binary representation of next number (GFG EASY)

  37. Longest Palindrome (LEETCODE EASY)

Heap

  1. Relative Ranks

  2. Kth Largest Element in an Array

  3. Kth smallest element

  4. Is Binary Tree Heap?

  5. Merge two binary Max heaps

  6. Minimum Cost Of ropes

  7. BST to max heap (USE INORDER AND POSTORDER TRAVERSAL)

  8. Does array represent Heap

  9. Convert Min heap into max Heap

  10. Sort a array

  11. Count Number of Homogenous Substrings (LEETCODE MEDIUM)

  12. Sort Characters by Frequency (LEETCODE MEDIUM)

Greedy

  1. N meetings in a room

  2. Shop in Candy Store

  3. Check if it is possible to survive on Island TRICKY

  4. Chocolate Distribution Problem

  5. Assign Cookies

  6. Fractional Knapsack

  7. Lemonade Change

  8. Eliminate Maximum Number of Monsters (LEETCODE Medium)

  9. Divide Array Into Arrays With Max Difference (LEETCODE MEDIUM)

  10. Furthest Building You can Reach (LEETCODE MEDIUM)

Dynamic Programming

  1. Fibonacci Series

  2. Climbing Stairs

  3. Frog Jump

  4. Maximum Sum Increasing subsequence

  5. New Year Resolution (GFG Medium)

  6. Longest Increasing Subsequence (LEETCODE MEDIUM)

  7. Grinding Geek (GFG MEDIUM)

  8. House Robbing (LEETCODE MEDIUM)

  9. Longest Common Subsequence from 2 string (LEETCODE MEDIUM)

  10. Longest Common Subsequence of 3 string (GFG MEDIUM)

  11. Plaindrome Substring

  12. Padovan Sequence (GFG EASY)

Binary Search

  1. First and Last Occurrence of X

  2. Find First and Second Position of Element in Sorted Array

Linked List

  1. Insert a sorted node

  2. Pairwise swapping

  3. Binary Tree to CDLL (GFG MEDIUM)

  4. Reverse Doubly Linked List (GFG EASY)

  5. Intersection of two sorted Linked Lists (GFG EASY)

    Merge 2 sorted list

  6. Merge 2 sorted linked list in reverse order

  7. Insertion Sort for Singly Linked List (GFG MEDIUM)

  8. Decimal Equivalent of Binary Linked List (GFG EASY)

  9. Sorted insert for circular linked list (GFG EASY)

  10. Palindrome or not

  11. Remove Nth Node from End

  12. Delete Middle Node

  13. Sort List

  14. Sort LL having 0,1 and 2 Intersection of Two Linked Lists

  15. Remove Duplicate from DLL

  16. Add 1 number

  17. Add 2 Linked List

  18. Find Pair of sum in DLL

  19. Delete all occurence of given node

  20. Rotate List

  21. Merge In Between Linked List (LEETCODE MEDIUM)

Binary Search Tree

  1. Search in Binary Search Tree
  2. Minimum in BST
  3. Inorder Traversal and BST
  4. Ceil in BST
  5. Floor in BST
  6. Insert Node in BST
  7. Brothers from Different Roots (GFG EASY 3 DEC)
  8. Delete Node in BST
  9. Invalid BST or not
  10. Lowest Common Ancestor of a BST
  11. Flaten BST (GFG MEDIUM)
  12. Sum of leaf nodes in BST (GFG MEDIUM)
  13. Minimum Element in BST (GFG BASIC)
  14. Minimum Absolute Difference in BST (GFG MEDIUM)
  15. Kth common ancestor in BST (GFG MEDIIUM)
  16. Pairs violating the BST property (GFG MEDIUM)

Graph

  1. BFT
  2. DFT
  3. Number of Provinces
  4. Rotting Oranges
  5. Flood Fill
  6. 0/1 Matrix
  7. Surrounding Region
  8. Topological Sort (DFS) /Kahn's Algoithm(BFS)
  9. Number of enclaves
  10. Word Ladder 1
  11. Detect cycle in directed graph
  12. Detect cycle in undirected graph
  13. Course Schedule
  14. Course Schedule 2
  15. Find Eventual Safe State
  16. Shortest Path in undirected graph
  17. Is it a tree? (GFG MEDIUM)
  18. Shortest Prime Path (GFG MEDIUM)
  19. Dijsktra
  20. Clone undirected graph (GFG MEDIUM)
  21. Word Search (LEETCODE MEDIUM)

Contributing

Contributions to this repository are currently not open to the public, as it is a collection of my personal solutions. However, if you find any issues with the provided solutions or have suggestions for additional problems or improvements, feel free to contact me directly.

Resources

Here are some additional resources that can help you in your DSA learning journey:

  • GeeksforGeeks: A comprehensive resource for learning algorithms, data structures, and programming concepts.

  • LeetCode: A popular platform for practicing coding interview questions.

    You can Connect with me here:

Please ⭐ this repo, If you find it useful ❤️

About

No description, website, or topics provided.

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages