This repository is a collection of the 'Problem of the Day'(POTD) solutions that I've written, or inspired from one of the solutions.
I already have a 100 day streak in the year of 2024. The reason I'm starting now is that I got this idea just a few days ago and what other day to start after achieving a milestone!!
The progress of those 100 days is written as a post in Leetcode, you can view it here
Click to see topic-wise solutions
- Array
- Back Tracking
- Binary Tree
- Binary Search
- Bit Manipulation
- Bitmask
- Breadth First Search
- Combinatorics
- Counting
- Counting Sort
- Depth First Search
- Enumeration
- Graph
- Greedy
- Hash Table
- Heap
- Linked List
- Math
- Matrix
- Monotonic Stack
- Prefix Sum
- Priority Queue
- Queue
- Simulation
- Sliding Window
- Sorting
- Stack
- String
- Tree
- Trie
- Two Pointers
- Topological-Sort
- Union-Find
Click to see the Day-wise progress!
2024
April
-
Day 101:
- Problem: 1700. Number of Students Unable to Eat Lunch (Easy)
- Solution: cpp solution
- Topics: Array, Stack, Queue, Simulation
-
Day 102:
- Problem: 2073 Time needed to buy tickets (Easy)
- Solution: cpp solution
- Topics: Array, Queue, Simulation
-
Day 103:
- Problem: 950. Reveal Cards In Increasing Order (Medium)
- Solution: cpp solution
- Topics: Array, Queue, Sorting, Simulation
-
Day 104:
- Problem: 402. Remove K Digits (Medium)
- Solution: cpp solution
- Topics: String, Stack, Greedy, Monotonic-Stack
-
Day 105:
- Problem: 85. Maximal Rectangle (Hard)
- Solution: cpp solution
- Topics: Array, Dynamic-Programming, Stack, Matrix, Monotonic-Stack
-
Day 106:
- Problem: 404. Sum of Left Leaves (Easy)
- Solution: cpp solution
- Topics: Tree, Depth-First-Search, Breadth-First-Search, Binary-Tree
-
Day 107:
- Problem: 129. Sum Root to Leaf Nodes (Medium)
- Solution: cpp solution
- Topics: Tree, Depth-First-Search, Binary-Tree
-
Day 108:
- Problem: 623. Add one Row to the Tree (Medium)
- Solution: cpp solution
- Topics: Tree, Depth-First-Search, Breadth-First-Search, Binary-Tree
-
Day 109:
- Problem: 988 Smallest String From Leaf (Medium)
- Solution: cpp solution
- Topics: String, Tree, Depth-First-Search, Binary-Tree
-
Day 110:
- Problem: 456 Island Perimeter (Easy)
- Solution: cpp solution
- Topics: Array, Matrix, Depth-First-Search, Breadth-First-Search
-
Day 111:
- Problem: 200 Count Islands (Medium)
- Solution: cpp solution
- Topics: Array, Depth-First-Search, Breadth-First-Search, Matrix, Union-Find
-
Day 112:
- Problem: 1992 Find all groups of FarmLand (Medium)
- Solution: cpp solution
- Topics: Array, Matrix, Depth-First-Search, Breadth-First-Search
-
Day 113:
- Problem: 1971 Find if path exists in Graph (Easy)
- Solution: cpp solution
- Topics: Graph, Union-Find, Depth-First-Search, Breadth-First-Search
-
Day 114:
- Problem: 152 Maximum Product Subarray (Medium)
- Solution: cpp solution
- Topics: Array, Dynamic-Programming
-
Day 115:
- Problem: 310 Minimum Height Trees (Medium)
- Solution: cpp solution
- Topics: Graph, Depth-First-Search, Breadth-First-Search, Topological-Sort
-
Day 116:
- Problem: 1137 Nth Tribonacci Number (Easy)
- Solution: cpp solution
- Topics: Math, Dynamic-Programming, Memoization
-
Day 117:
- Problem: 2370 Longest Ideal Subsequence (Medium)
- Solution: cpp solution
- Topics: String, Hash-Table, Dynamic-Programming
-
Day 118:
- Problem: 1289 Minimum Falling Path Sum II (Hard)
- Solution: cpp solution
- Topics: Array, Dynamic-Programming, Matrix
-
Day 119:
- Problem: 514 Freedom Trail (Hard)
- Solution: cpp solution
- Topics: String, Dynamic-Programming, Breadth-First-Search, Depth-First-Search
-
Day 120:
- Problem: 834 Sum of Distances in Tree (Hard)
- Solution: cpp solution
- Topics: Graph, Tree, Dynamic-Programming, Tree
-
Day 121:
- Problem: 2997 Minimum Number of Operations to Make Array XOR Equal to K (Medium)
- Solution: cpp solution
- Topics: Array, Bit-Manipulation
-
Day 122:
- Problem: 1915 Number of Wonderful Substrings (Medium)
- Solution: cpp solution
- Topics: Bit-Manipulation, Prefix-Sum, Hash-Table, String
May
-
Day 123:
- Problem: 2000 Reverse Prefix Of Word (Easy)
- Solution: cpp solution
- Topics: String, Two-Pointers
-
Day 124:
- Problem: 2441 Largest Positive Integer that exists with its negative (Easy)
- Solution: cpp solution
- Topics: Array, Hash-Table, Two-Pointers, Sorting
-
Day 125:
- Problem: 165 Compare Version Numbers (Medium)
- Solution: cpp solution
- Topics: String, Two-Pointers
-
Day 126:
- Problem: 881 Boats to save people (Medium)
- Solution: cpp solution
- Topics: Sorting, Greedy, Array, Two-Pointers
-
Day 127:
- Problem: 237 Delete Node in a Linked List [Medium]
- Solution: cpp solution
- Topics: Linked-List
-
Day 128:
- Problem: 2487 Remove Nodes From Linked List [Medium]
- Solution: cpp solution
- Topics: Linked-List, Stack, Recursion, Monotonic-Stack
-
Day 129:
- Problem: 2816 Double a Number Represented as a Linked List (Medium)
- Solution: cpp solution
- Topics: Linked-List, Math, Stack
-
Day 130:
- Problem: 506 Relative Ranks (Easy)
- Solution: cpp solution
- Topics: Array, Sorting, Heap, Priority-Queue
-
Day 131:
- Problem: 3075 Maximize Happiness of Selected Children (Medium)
- Solution: cpp solution
- Topics: Array, Greedy, Sorting
-
Day 132:
- Problem: 786 Kth Smallest Prime Fraction (Medium)
- Solution: cpp solution
- Topics: Array, Two-Pointers, Binary-Search, Sorting, Heap, Priority-Queue
-
Day 133:
- Problem: 857 Minimum Cost to hire K workers (Hard)
- Solution: cpp solution
- Topics: Array, Greedy, Sorting, Heap, Priority-Queue
-
Day 134:
- Problem: 2373 Largest Local Values in a Matrix (Easy)
- Solution: cpp solution
- Topics: Array, Matrix
-
Day 135(copied):
- Problem: 861 Score After Flipping the Matrix (Medium)
- Solution: cpp solution
- Topics: Array, Greedy, Matrix, Bit-Manipulation
-
Day 136(copied):
- Problem: 1219 Path with Maximum Gold (Medium)
- Solution: cpp solution
- Topics: Array, Matrix, Back-Tracking
-
Day 137(copied):
- Problem: 2812 Find the safest path in a grid (Medium)
- Solution: cpp solution
- Topics: Array, Matrix, Binary-Search, Union-Find, Breadth-First-Search
-
Day 138:
- Problem: 2331 Evaluate Boolean Binary Tree (Easy)
- Solution: cpp solution
- Topics: Tree, Binary-Tree, Depth-First-Search
-
Day 139:
- Problem: 1325 Delete Leaves with a Given Value (Medium)
- Solution: cpp solution
- Topics: Tree, Binary-Tree, Depth-First-Search
-
Day 140:
- Problem: 979 Distribute Coins in a Binary Tree (Medium)
- Solution: cpp solution
- Topics: Tree, Binary-Tree, Depth-First-Search
-
Day 141:
- Problem: 3068 Find the maximum sum of Node Values (Hard)
- Solution: cpp solution
- Topics: Array, Greedy, Tree, Sorting, Dynamic-Programming, Bit-Manipulation
-
Day 142:
- Problem: 1863 Sum of all Subset XOR Totals (Easy)
- Solution: cpp solution
- Topics: Array, Math, Back-Tracking, Bit-Manipulation, Combinatorics, Enumeration
-
Day 143:
- Problem: 78 Subsets (Medium)
- Solution: cpp solution
- Topics: Array, Back-Tracking, Bit-Manipulation
-
Day 144:
- Problem: 131 Palindrome Partitioning (Medium)
- Solution: cpp solution
- Topics: String, Dynamic-Programming, Sorting
-
Day 145:
- Problem: 2597 The Number of Beautiful Subsets (Medium)
- Solution: cpp solution
- Topics: Array, Back-Tracking, Sorting, Dynamic-Programming
-
Day 146:
- Problem: 1255 Maximum Score Words formed by Letters (Hard)
- Solution: cpp solution
- Topics: Array, String, Bit-Manipulation, Bitmask, Back-Tracking, Dynamic-Programming
-
Day 147:
- Problem: 140 Word Break II (Hard)
- Solution: cpp solution
- Topics: Array, String, Trie, Memoization, Hash-Table, Back-Tracking, Dynamic-Programming
-
Day 148:
- Problem: 552 Student Attendance Record II (Hard)
- Solution: cpp solution
- Topics: Dynamic-Programming
-
Day 149:
- Problem: 1608 Special Elements with X Elements greater than or equal X (Easy)
- Solution: cpp solution
- Topics: Array, Sorting, Binary-Search
-
Day 150:
- Problem: 1208 Get Equal Substrings within Budget (Medium)
- Solution: cpp solution
- Topics: String, Prefix-Sum, Sliding-Window, Binary-Search
-
Day 151:
- Problem: 1404 Number of Steps to reduce a Number in Binary Representation to One (Medium)
- Solution: cpp solution
- Topics: String, Bit-Manipulation
-
Day 152:
- Problem: 1442 Count Triplets that can form Two Arrays of Equal XOR (Medium)
- Solution: cpp solution
- Topics: Array, Math, Prefix-Sum, Hash-Table, Bit-Manipulation
-
Day 153:
- Problem: 260 Single Number III (Medium)
- Solution: cpp solution
- Topics: Array, Bit-Manipulation
June
-
Day 154:
- Problem: 3110 Score of a String (Easy)
- Solution: cpp solution
- Topics: String
-
Day 155:
- Problem: 344 Reverse String (Easy)
- Solution: cpp solution
- Topics: String, Two-Pointers
-
Day 156:
- Problem: 2486 Append Character to String to make Subsequence (Medium)
- Solution: cpp solution
- Topics: String, Greedy, Two-Pointers
-
Day 157:
- Problem: 409 Longest Palindrome (Easy)
- Solution: cpp solution
- Topics: String, Greedy, Hash-Table
-
Day 158:
- Problem: 1002 Find Common Characters (Easy)
- Solution: cpp solution
- Topics: String, Array, Hash-Table
-
Day 159:
- Problem: 846 Hand of Straights (Medium)
- Solution: cpp solution
- Topics: Array, Greedy, Sorting, Hash-Table
-
Day 160:
- Problem: 648 Replace Words (Medium)
- Solution: cpp solution
- Topics: Array, String, Trie, Hash-Table
-
Day 161:
- Problem: 523 Continuos SubArray Sum (Medium)
- Solution: cpp solution
- Topics: Array, Math, Prefix-Sum, Hash-Table
-
Day 162:
- Problem: 974 Subarray Sums Divisble by K (Medium)
- Solution: cpp solution
- Topics: Array, Prefix-Sum, Hash-Table
-
Day 163:
- Problem: 1051 Height Checker (Easy)
- Solution: cpp solution
- Topics: Array, Sorting, Counting-Sort
-
Day 164:
- Problem: 1122 Relative Sort Array (Easy)
- Solution: cpp solution
- Topics: Array, Hash-Table, Sorting, Counting-Sort
-
Day 165:
- Problem: 75 Sort Colors (Medium)
- Solution: cpp solution
- Topics: Array, Sorting, Two-Pointers
-
Day 166:
- Problem: 2037 Minimum number of moves to seat Everyone (Easy)
- Solution: cpp solution
- Topics: Array, Greedy, Sorting
-
Day 167:
- Problem: 945 Minimum Increment to make array Unique (Medium)
- Solution: cpp solution
- Topics: Array, Greedy, Sorting, Counting