๐ฑ One problem a day keeps the bugs away!
This repo is my personal log of solving Data Structures & Algorithms problems daily on LeetCode.
| Date | Problem | Difficulty | Notes |
|---|---|---|---|
| Oct 7 - 25 | Merge Two Sorted Lists | Easy | Used dummy node + pointer iteration to merge two sorted linked lists in O(n + m). |
| Oct 21, 2025 | Reverse Linked List | Easy | Reversed singly linked list iteratively using three pointers (prev, curr, next). O(n) time, O(1) space. |
| Oct 20, 2025 | Median of Two Sorted Arrays | Hard | Used binary search on the smaller array to partition both arrays such that left half โค right half; computed median based on even/odd combined length. |
| Oct 19, 2025 | Time-Based Key-Value Store | Medium | Used a hash map of lists storing (timestamp, value) pairs per key; applied binary search to retrieve the value with the largest timestamp โค target. |
| Oct 18, 2025 | Search in Rotated Sorted Array | Medium | Binary search with rotation logic at each step, determine which half is sorted and decide which side to discard. |
| Oct 17, 2025 | Find Minimum in Rotated Sorted Array | Medium | Used binary search to locate the rotation pivot by comparing mid and right elements; efficiently narrows search space to find the minimum in O(log n) time. |
| Oct 16 - 25 | Koko Eating Bananas | Medium | Applied binary search on eating speed range (1 to max pile). Checked total hours at each mid speed to find the minimum feasible rate. |
| Oct 15 - 25 | Search a 2D Matrix | Medium | Flattened 2D matrix and applied binary search logic using row/col calculation. |
| Oct 14 - 25 | Binary Search | Easy | Implemented standard binary search using left/right pointers, O(log n) time complexity. |
| Oct 13 - 25 | Largest Rectangle in Histogram | Hard | Used a monotonic increasing stack storing (height, start index). When a smaller bar appears, pop taller bars, calculate area using width i - j, and track max. |
| Oct 12 - 25 | Car Fleet | Medium | Sort by position desc, compute time = (target - pos)/speed, use stack to count fleets |
| Oct 11 - 25 | Daily Temperatures | Medium | Monotonic stack storing indices to find warmer days, O(n) |
| Oct 11 - 25 | Generate Parentheses | Medium | Backtracking with open/close counts to form valid combinations |
| Oct 10 - 25 | Evaluate Reverse Polish Notation | Medium | Stack-based evaluation of postfix expressions, O(n) time. |
| Oct 9 - 25 | Min Stack | Medium | Used two stacks โ one for values, one for mins. |
| Oct 8 - 25 | Valid Parentheses | Easy | Used stack + hash map to validate brackets, returned not stack or len(stack) == 0 after full scan. |
| Oct 7 - 25 | Sliding Window Maximum | Hard | Monotonic deque for O(n) max tracking in each window |
| Oct 7 - 25 | Minimum Window Substring | Hard | Expandโshrink window using two pointers + hash maps to find smallest substring covering target |
| Oct 7 - 25 | Permutation in String | Medium | Sliding window + Counter + frequency match |
| Oct 6 - 25 | Longest Repeating Character Replacement | Medium | Sliding window + HashMap + max frequency logic |
| Oct 6 - 25 | Longest Substring Without Repeating Characters | Medium | Sliding window + HashSet for unique chars |
| Oct 6 - 25 | Best Time to Buy and Sell Stock | Easy | Track min price, update max profit (one pass) |
| Oct 5 - 25 | Trapping Rain Water | Hard | Two pointers + left/right max tracking |
| Oct 5 - 25 | Container With Most Water | Medium | Two pointers, move smaller line |
| Oct 5 - 25 | 3Sum | Medium | Two pointers + skip duplicates |
| Oct 4 - 25 | Two Sum II - Input Sorted | Medium | Two-pointer technique, O(1) space |
| Oct 4 - 25 | Valid Palindrome | Easy | Two-pointer, skip non-alnum, lowercase |
| Oct 4 - 25 | Valid Sudoku | Medium | Rows/Cols/3ร3 boxes with sets |
| Oct 3 - 25 | Longest Consecutive Sequence | Medium | HashSet for O(n) seq |
| Oct 3 - 25 | Encode and Decode Strings | Medium | String serialization |
| Oct 3 - 25 | Top K Frequent Elements | Medium | HashMap + heap |
| Oct 3 - 25 | Group Anagrams | Medium | HashMap with big tuple key |
| Oct 2 - 25 | Product of Array Except Self | Medium | Prefix/suffix products |
| Oct 2 - 25 | Two Sum | Easy | Hash map pattern |
| Oct 2 - 25 | Contains Duplicate | Easy | Set lookup |
| Oct 2 - 25 | Valid Anagram | Easy | Hash map/sorting |