✅ Topics for Day 6 DSA with Java
Focus : Two Pointer Technique 🔁 1. Learn & Implement Two Pointer Technique Understand how the two-pointer technique works on sorted arrays. Implement the following problems: // Java Example: Two Sum (Sorted Array) public int [] twoSum( int [] numbers, int target) { int left = 0 , right = numbers.length - 1 ; while (left < right) { int sum = numbers[left] + numbers[right]; if (sum == target) { return new int [] { left + 1 , right + 1 }; // 1-indexed } else if (sum < target) { left++; } else { right--; } } return new int [] {}; // no solution } 🧠 2. Solve 2 LeetCode Problems Using Two Pointers LeetCode 167. Two Sum II – Input Array Is Sorted LeetCode 283. Move Zeroes Optimize with minimal swaps using the two-pointer pattern. ✨ Bonus Challenges (Optional but Recommended) LeetCode 26. Remove Duplicates from Sorted Array LeetCode 844....