GfG160: 160 Days of DSA Problems

Complete Topic-wise Overview

1. Arrays (Days 1–13)

  • Second Largest
  • Move All Zeroes to End
  • Reverse an Array
  • Rotate Array
  • Next Permutation
  • Majority Element II
  • Stock Buy & Sell (Multiple)
  • Stock Buy & Sell (One Transaction)
  • Minimize the Heights I
  • Kadane's Algorithm
  • Maximum Product Subarray
  • Max Circular Subarray Sum
  • Smallest Positive Missing Number

2. Strings (Days 14–20)

  • Implement Atoi
  • Add Binary Strings
  • Anagram
  • First Non-Repeating Character
  • Search Pattern (KMP)
  • Minimum Characters for Palindrome
  • String Rotations of Each Other

3. Sorting (Days 21–27)

  • Sort 0s, 1s, and 2s
  • Find H-Index
  • Count Inversions
  • Overlapping Intervals
  • Insert Interval
  • Non-overlapping Intervals
  • Merge Without Extra Space

4. Searching (Days 28–35)

  • Number of Occurrences
  • Minimum in Sorted & Rotated Array
  • Search in Rotated Sorted Array
  • Peak Element
  • K-th Element of Two Arrays
  • Aggressive Cows
  • Allocate Minimum Pages
  • Kth Missing Positive Number

5. Matrix (Days 36–41)

  • Spirally Traverse Matrix
  • Rotate by 90°
  • Search in Row-Column Sorted Matrix
  • Search in Row-Wise Sorted Matrix
  • Search in Sorted Matrix
  • Set Matrix Zeroes

6. Hashing (Days 42–49)

  • Two Sum
  • Count Pairs with Given Sum
  • Find All Triplets with Zero Sum
  • Intersection of Two Arrays
  • Union of Arrays with Duplicates
  • Longest Consecutive Subsequence
  • Print Anagrams Together
  • Subarrays with Sum K
  • Count Subarrays with Given XOR

7. Two-Pointer (Days 50–61)

  • Count Triplets with Given Sum
  • Count Pairs with Sum Less Than Target
  • Sum Pair Closest to Target
  • Pair with Given Sum (Sorted Array)
  • Count Possible Triangles
  • Indices of Subarray Sum
  • Count Distinct Elements in Every Window
  • Longest Substring with Distinct Characters
  • Trapping Rain Water
  • Container With Most Water

9. Linked List (Days 67–76)

  • Reverse a Linked List
  • Rotate a Linked List
  • Merge Two Sorted Linked Lists
  • Reverse Nodes in K-Group
  • Add Number Linked Lists
  • Clone List with Next and Random
  • Detect Loop in Linked List
  • Find the First Node of Loop
  • Remove Loop
  • LRU Cache

11. Tree (Days 80–92)

  • Level-Order Traversal
  • Height of Binary Tree
  • Diameter of a Binary Tree
  • Mirror Tree
  • Construct Tree from Inorder & Preorder
  • Inorder Traversal
  • Boundary Traversal
  • Maximum Path Sum from Any Node
  • K-Sum Paths
  • Check for BST
  • kth Smallest in BST
  • Pair Sum in BST
  • Fix Two Swapped Nodes of a BST
  • Lowest Common Ancestor in BST
  • Serialize & Deserialize a Binary Tree

15. Dynamic Programming (Days 108–133)

  • Longest Increasing Subsequence
  • Longest String Chain
  • Longest Common Subsequence
  • Longest Palindromic Subsequence
  • Longest Palindrome in a String
  • Palindromic Substrings
  • Edit Distance
  • Ways to Reach the nth Stair
  • Min Cost Climbing Stairs
  • 0–1 Knapsack
  • Coin Change (Count Ways)
  • Coin Change (Min Coins)
  • Minimum Jumps
  • Subset Sum Problem
  • Partition Equal Subset Sum
  • Stock Buy & Sell – Max K Transactions

17. Graph (Days 138–152)

  • DFS of Graph
  • BFS of Graph
  • Rotten Oranges
  • Undirected Graph Cycle Detection
  • Number of Islands
  • Topological Sort
  • Directed Graph Cycle Detection
  • Bridge Edge in Graph
  • Articulation Point
  • Minimum Cost to Connect All Houses
  • Dijkstra's Algorithm
  • Flood Fill Algorithm
  • Account Merge
  • Clone an Undirected Graph
  • Alien Dictionary