LeetCode 54 – Spiral Matrix
Solved: Return all elements of a matrix in spiral order
Used boundaries: top, bottom, left, right
Moved layer by layer inward while collecting elements
Great for mastering 2D traversal logic!
#100DaysOfCode#LeetCode#PythonDSA#MatrixProblems
LeetCode 53 – Maximum Subarray
Solved: Find the subarray with the maximum sum
Applied Kadane’s Algorithm
Track running sum, reset if it drops below 0
Time: O(n), Space: O(1)
Perfect to build prefix thinking & subarray mastery!
#PythonDSA#LeetCode#Kadane#LearnInPublic
LeetCode 796 – Rotate String
Solved: Check if one string is rotation of another
Trick: s2 must be a substring of s1 + s1
Simple check with in operator
O(n²) worst-case, O(1) extra space
Neat and elegant string trick!
#LeetCode#100DaysOfCode#PythonDSA#Strings#DSA
LeetCode 704 – Binary Search
Solved: Classic binary search on sorted array
Kept adjusting low, high till target found or not
Time complexity: O(log n)
Foundations of efficient search algorithms!
#LeetCode#PythonDSA#100DaysOfCode#BinarySearch
LeetCode 81 – Search in Rotated Sorted Array II
Solved: Like LC33 but with duplicates
Modified Binary Search
Skip duplicates if nums[left] == nums[mid] == nums[right]
Still O(log n) in best case, O(n) worst case due to duplicates
#LeetCode#100DaysOfCode#PythonDSA#BinarySearch
LeetCode 75 – Sort Colors
Solved: Sort an array of 0s, 1s, and 2s in-place
Used Dutch National Flag Algorithm
Three pointers to sort in one pass → O(n) time, O(1) space
Loved how elegant & efficient this approach is!
#LeetCode#PythonDSA#SortingAlgorithms
LeetCode 560 – Subarray Sum Equals K
Solved: Count subarrays whose sum equals k
Brute: O(n²) with prefix sums
Optimal: O(n) using hashmap + prefix sum
Powerful combo of hashing & prefix logic!
#LeetCode#100DaysOfCode#PythonDSA#PrefixSum#HashMap
LeetCode 35 – Search Insert Position
Solved: Find the index to insert target in sorted array
Binary Search approach → O(log n)
If found, return index. If not, return where it should be inserted.
Clean & classic binary search twist!
#PythonDSA#LeetCode#BinarySearch
LeetCode 540 – Single Element in a Sorted Array
Find element that appears once in sorted array
Binary search with index parity logic
Pairs start at even index before single element
Shift search space based on mid’s pairing
O(log n) time, O(1) space
#BinarySearch#DSA#PythonDSA
LeetCode 49 – Group Anagrams
Solved: Group strings that are anagrams of each other
Used hashmap with sorted string as key
Collected anagrams into lists based on character signature.
Great use of hashmaps + sorting combo!
#LeetCode#PythonDSA#HashMap#LearnInPublic
LeetCode 1089 – Duplicate Zeros
Solved: Duplicate each zero in the array in-place, shifting elements right
Used two passes:
Count how many zeros can be duplicated
Fill from the back using reverse two-pointer
Great for tricky in-place logic!
#LeetCode#PythonDSA#ArrayProblems
LeetCode 414 – Third Maximum Number
Solved: Find the 3rd distinct max number in the array
Used a set to track unique values
Handled edge case: return max if < 3 distinct numbers
Cleans up logic around max tracking & uniqueness!
#LeetCode#PythonDSA#ArrayProblems
Day-18 #100DaysOfCode#100DaysOfCodeChallenge
-Watched Python Django basics tutorial from programming with Mosh youtube channel till the debug tool part. (I will come back to this n go through this quickly to revise the basics)
-Solved one easy question on leetcode.
#pythondsa
LeetCode 705 – Design HashSet
Solved: Build a basic HashSet from scratch
Implemented with a list of buckets (chaining method)
Covered add(), remove(), contains()
Solid intro to DS design & hashing logic
#LeetCode#DataStructures#PythonDSA#HashSet
LeetCode 26 – Remove Duplicates from Sorted Array
Solved: In-place removal of duplicates from sorted array.
Used two pointers to overwrite unique values.
No extra space. O(n) time.
Classic pointer game — clean & powerful!
#PythonDSA#LeetCode#ArrayProblem
LeetCode 118 – Pascal’s Triangle
Solved: Generate Pascal’s Triangle up to numRows
Built each row from the previous using simple math
Classic pattern-building problem — clean & recursive!
Loved the structure & symmetry!
#LeetCode#PythonDSA#Patterns
Solved today’s LeetCode Daily Challenge
1394. Find Lucky Integer in an Array
Used a frequency map to count occurrences.
Then filtered values where value == frequency.
Returned the maximum lucky integer found (or -1 if none).
#LeetCode#PythonDSA#DailyChallenge