
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 เทรนด์
- 1. Columbus 176K posts
- 2. President Trump 1.17M posts
- 3. Middle East 284K posts
- 4. Brian Callahan 11.3K posts
- 5. #IndigenousPeoplesDay 13.3K posts
- 6. Azzi 7,739 posts
- 7. Titans 42.9K posts
- 8. Thanksgiving 57.7K posts
- 9. Vrabel 7,565 posts
- 10. Cape Verde 19.2K posts
- 11. Macron 230K posts
- 12. Marc 52.1K posts
- 13. #Isles 1,634 posts
- 14. HAZBINTOOZ 6,510 posts
- 15. Seth 51.8K posts
- 16. #UFC323 2,111 posts
- 17. Sabres 3,697 posts
- 18. Apple TV 6,097 posts
- 19. Native Americans 14.3K posts
- 20. $GIGGLE 5,459 posts
Something went wrong.
Something went wrong.