scripted_solns's profile picture. 🚀 Turning ideas into code
💡 Simplifying tech | 🎮 Gamifying learning
 | 💻 Sharing dev hacks 
#100DaysOfCode #TechForGood #DevLife

Scripted Solutions

@scripted_solns

🚀 Turning ideas into code 💡 Simplifying tech | 🎮 Gamifying learning | 💻 Sharing dev hacks #100DaysOfCode #TechForGood #DevLife

🚀 Day 22/100 — #LeetCode Solved “Reverse Words in a String” (Medium) 💡 Key Idea: 🔹 Split the string into words 🔹 Use a stack (or reverse iteration) to reverse their order 🔹 Join them back with spaces — careful to avoid trailing spaces #100DaysOfCode #LeetCode #DSA


🚀 Day 21/100 — #LeetCode Solved “Remove Outermost Parentheses” (Easy) Key idea: 🔹 Track nesting with a level counter 🔹 Only add parentheses that are not outermost 🔹 Increment level for '(' and decrement for ')' #100DaysOfCode #DSA #LeetCode #cpp


🚀 Day 20/100 — #LeetCode 💡 Problem: Search a 2D Matrix II (Medium) Start from the top-right: = target → ✅ found < target → move ↓ target → move ← ⏱️ O(n+m) | 📦 O(1) #100DaysOfCode #LeetCode #DSA #CodingJourney


🚀 Day 19/100 — #LeetCode 💡 Problem: Search a 2D Matrix (Medium) 🔑 Idea: Treat the 2D matrix as a 1D sorted array and apply binary search using index mapping: row = mid / m, col = mid % m ⏱️ Time Complexity: O(log(n × m)) #100DaysOfCode #DSA #CodingJourney #ProblemSolving


🚀 Day 18/100 — #LeetCode Solved “Median of Two Sorted Arrays” (Hard) 🔑 Idea: Use binary search on the smaller array to find correct partition where left ≤ right. Then take median from boundary elements. ⏱️ O(log min(n, m)) #100DaysOfCode #DSA


🚀 Day 17/100 — #LeetCode Solved “Find the Smallest Divisor Given a Threshold” (Medium) 🔑 Idea: Binary search on divisor → use helper fn to check if sum(nums/divisor) ≤ threshold. Adjust range between 1 and max(nums) until minimum feasible divisor found #100DaysOfCode #DSA


🚀 Day 16/100 — #LeetCode Solved 410. Split Array Largest Sum 💥 (Hard) 🔑 Use Binary Search + Greedy to find the minimum possible largest subarray sum when splitting into k parts. Range = [max(nums), sum(nums)] #100DaysOfCode #DSA #BinarySearch #LeetCode


🚀 Day 15/100 — #LeetCode Solved “1539. Kth Missing Positive Number” (Easy) 🔑 Idea: Use binary search to find smallest index i where arr[i] - (i+1) ≥ k. Then answer = i + k. #100DaysOfCode #DSA #BinarySearch


🚀 Day 14/100 — #LeetCode Solved “Capacity To Ship Packages Within D Days” (Medium) 🔑 Idea: Binary search on ship capacity → use helper fn to count required days. Adjust range between max(weights) and sum(weights) until minimum feasible capacity found. #100DaysOfCode #DSA


🚀 Day 13/100 — #LeetCode Solved “Minimum Days to Make m Bouquets” 🌸 (Medium) 🔑 Idea: Binary search on days → check if m bouquets possible with helper fn. Edge case: if m*k > n → return -1 ❌ #100DaysOfCode #DSA


🐵 Day 12/100 — #KokoBanana Solved “Eating Bananas” 🍌 🔑 Idea: Use binary search. If Koko eats too slow → not enough time. If too fast → waste effort. Find the just right speed. ⚡ Edge: 1 pile only → eat whole at once. #100DaysOfCode #DSA


🚀 Day 11/100 — #LeetCode Solved “Single Element in a Sorted Array” (Medium) 🔑 Idea: Use binary search. Pairs start at even indices → if not, unique lies left. Shrink space till found. ⚡ Edge: size=1 → return. #100DaysOfCode #DSA


🚀 Day 10/100 — #LeetCode Solved “Find Minimum in Rotated Sorted Array” (Medium) Key idea: 🔹 Binary search for rotation point 🔹 If mid > right → go right 🔹 Else → go left 🔹 Stop when left == right → min #100DaysOfCode #DSA


🚀 Day 9/100 — #LeetCode Solved “Search in Rotated Sorted Array II” (Medium) Key idea: 🔹 Modified binary search with duplicates 🔹 If nums[left] == nums[mid] == nums[right], shrink boundaries 🔹 Otherwise pick the sorted half #100DaysOfCode #DSA


🚀 Day 8/100 — #LeetCode Solved “Search in Rotated Sorted Array” (Medium) Key idea: Use modified binary search to find the target. Determine which half of the array is sorted at each step. Narrow down the search space accordingly. ⚠️ Handle edge cases. #100DaysOfCode #DSA


🚀 Day 7/100 — #LeetCode Solved “First and Last Occurrence of an Element” (Easy) Key idea: Use binary search twice — once to find the first occurrence and once for the last occurrence. Handle edge cases carefully when the target is not found ⚠️ #100DaysOfCode #DSA


🚀 Day 6/100 — #LeetCode Solved “Maximum Product Subarray” (Medium) ⚡ Key idea: Track both max & min products at each step (because a negative × negative = positive). Update answer as you go 🔄 This trick handles negative numbers elegantly 💡 #100DaysOfCode #DSA


🚀 Day 5/100 — #LeetCode Solved “4Sum” (Medium) 🎯 Key idea: Sort the array first ➡️ Fix two numbers using a loop ➡️ Use two pointers for the remaining two numbers ➡️ Skip duplicates to avoid repeating combinations. What’s your go-to trick for problem? 👇 #100DaysOfCode #DSA


🚀 Day 4/100 — #LeetCode Solved “Merge Intervals” (Medium) 🎯 Key idea: Sort all intervals first ➡️ start with the first interval and keep merging overlapping ones using ans.back() until no overlap remains. What’s your go-to trick for handling problem? 👇 #100DaysOfCode #DSA


🚀 Day 3/100 — #LeetCode Solved “3Sum” (Medium) 🎯 Key idea: Sort the array first ➡️ then fix one element and use the two-pointer approach to find pairs that add up to the target (here, zero). What’s your go-to strategy for tackling 3-sum style problems? 👇 #100DaysOfCode #DSA


United States เทรนด์

Loading...

Something went wrong.


Something went wrong.