Solved LeetCode 287 with HashSet, learned about optimization and focus

Title: 🔍 Day 4 of #LearningOfCode — Finding Duplicates in Code and in Mindset 💡 Body: Today’s challenge: LeetCode 287 – Find the Duplicate Number 🧠 At first, it looked like a simple array problem… but it taught me a deep lesson about optimization and focus. Here’s how I approached it 👇 ✅ Tried sorting — worked but costly (O(n log n)) ✅ Tried HashSet — faster, but used extra space (O(n)) 💬 What I learned: Finding “duplicates” in data is like finding distractions in life — once you identify them, the path becomes clearer and faster. Each optimized solution brings me closer to becoming a more efficient engineer — not just in code, but in thought. 💪 #LeetCode #ProblemSolving #DSA #LearnInPublic #SoftwareEngineering #CareerGrowth #100DaysOfCode #Motivation #CodingJourney

  • graphical user interface

To view or add a comment, sign in

Explore content categories