Day 2 of 100 Days of DSA: Stock and String Problems

🚀 Day 2/100 – #100DaysOfDSA Continuing the journey with two interesting problems today! 🔹 Problems Solved: Best Time to Buy and Sell Stock Reverse String 💡 Key Learnings: 👉 Problem 1: Best Time to Buy & Sell Stock Used a greedy + two pointer mindset Track the minimum price so far (buy) and calculate profit at each step Update max profit whenever a better opportunity appears ✅ O(n) Time ✅ O(1) Space 👉 Problem 2: Reverse String Classic Two Pointer Technique One pointer at start, one at end Swap characters and move inward ✅ In-place solution ✅ No extra memory used 🔥 What I learned today: Sometimes the best solutions are not complex — just about tracking the right values at the right time. Consistency > Perfection. See you on Day 3 💪 #100DaysOfCode #DSA #LeetCode #ProblemSolving #CodingJourney #JavaScript #Developers #TechGrowth #SoftwareEngineer #LearningInPublic

To view or add a comment, sign in

Explore content categories