Solved LeetCode Day 3: Longest Substring Without Repeating Characters in Java

🎯 LeetCode — Day 3 | “Longest Substring Without Repeating Characters” (Medium, Java) 💭 Ever tried remembering all your passwords without repeating any character? That’s pretty much what this problem felt like 😅 Today’s challenge tested my patience and precision — finding the longest substring without repeating characters. 🧩 Key Idea: Use a sliding window with a HashMap to track character positions. Every time a duplicate appears, move the start pointer forward ->simple, elegant, efficient! ⚡ Result: ✅ Accepted | ⏱ Runtime: 0 ms 💪 Complexity: O(n) 💡 Logic: Focus on “expanding and shrinking” the window smartly Each day’s logic builds the next day’s confidence. #LeetCode #Day3 #Java #CodingJourney #ProblemSolving #DSA #TechMindset #Motivation

  • text

To view or add a comment, sign in

Explore content categories