Two Sum Problem Solving with Hashmap in JavaScript

Day 1 of improving my problem-solving skills 🚀 Tried solving Two Sum today. Logic was clear… implementation humbled me 😅 Got stuck not because of approach, but something basic — hashmap syntax. 👉 Today’s learning: Using a hashmap (Map in JS) reduces time complexity from O(n²) → O(n) Knowing syntax matters as much as knowing the idea Most used Map functions: set(key, value) get(key) has(key) Small steps, consistent effort 📈 #DSA #JavaScript #Fullstack #LearnInPublic

  • text

To view or add a comment, sign in

Explore content categories