Week 2(Day 10): LeetCode Two Pointers(slow & fast): Remove Duplicates from Sorted Array (Brute…
📰 Medium · Python
Learn to remove duplicates from a sorted array using the two pointers technique, improving from brute force to optimized solutions
Action Steps
- Read the LeetCode problem statement for Remove Duplicates from Sorted Array
- Apply the brute force approach to understand the problem
- Implement the two pointers technique using slow and fast pointers to optimize the solution
- Test the optimized solution with sample inputs to verify its correctness
- Compare the time and space complexity of the brute force and optimized solutions
Who Needs to Know This
Software engineers and developers can benefit from this technique to improve their coding skills and efficiency in solving array-related problems
Key Insight
💡 The two pointers technique can significantly improve the efficiency of solving array-related problems by reducing time and space complexity
Share This
💡 Remove duplicates from sorted arrays efficiently using two pointers technique!
Key Takeaways
Learn to remove duplicates from a sorted array using the two pointers technique, improving from brute force to optimized solutions
Full Article
Title: Week 2(Day 10): LeetCode Two Pointers(slow & fast): Remove Duplicates from Sorted Array (Brute…
URL Source: https://medium.com/@sathiyarajanm/week-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305?source=rss------python-5
Published Time: 2026-06-20T22:25:41Z
Markdown Content:
# Week 2(Day 9): LeetCode Two Pointers(slow & fast): Remove Duplicates from Sorted Array (Brute Force → Optimized) | by Sathiyarajan Mariyappan | Jun, 2026 | Medium
[Sitemap](https://medium.com/sitemap/sitemap.xml)
[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNavBar&source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)
[](https://medium.com/?source=post_page---top_nav_layout_nav-----------------------------------------)
Get app
[Write](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)
[Search](https://medium.com/search?source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

# Week 2(Day 9): LeetCode Two Pointers(slow & fast): Remove Duplicates from Sorted Array (Brute Force → Optimized)
[](https://medium.com/@sathiyarajanm?source=post_page---byline--d915d9dd4305---------------------------------------)
[Sathiyarajan Mariyappan](https://medium.com/@sathiyarajanm?source=post_page---byline--d915d9dd4305---------------------------------------)
Follow
8 min read
·
1 hour ago
[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fp%2Fd915d9dd4305&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&user=Sathiyarajan+Mariyappan&userId=850a26632d9b&source=---header_actions--d915d9dd4305---------------------clap_footer------------------)
[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Frepost%2Fp%2Fd915d9dd4305&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&user=Sathiyarajan+Mariyappan&userId=850a26632d9b&source=---header_actions--d915d9dd4305---------------------repost_header------------------)
[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2Fd915d9dd4305&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&source=---header_actions--d915d9dd4305---------------------bookmark_footer------------------)
[Listen](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2Fplans%3Fdimension%3Dpost_audio_button%26postId%3Dd915d9dd4305&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&source=---header_actions--d915d9dd4305-----------------
URL Source: https://medium.com/@sathiyarajanm/week-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305?source=rss------python-5
Published Time: 2026-06-20T22:25:41Z
Markdown Content:
# Week 2(Day 9): LeetCode Two Pointers(slow & fast): Remove Duplicates from Sorted Array (Brute Force → Optimized) | by Sathiyarajan Mariyappan | Jun, 2026 | Medium
[Sitemap](https://medium.com/sitemap/sitemap.xml)
[Open in app](https://play.google.com/store/apps/details?id=com.medium.reader&referrer=utm_source%3DmobileNavBar&source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)
[](https://medium.com/?source=post_page---top_nav_layout_nav-----------------------------------------)
Get app
[Write](https://medium.com/m/signin?operation=register&redirect=https%3A%2F%2Fmedium.com%2Fnew-story&source=---top_nav_layout_nav-----------------------new_post_topnav------------------)
[Search](https://medium.com/search?source=post_page---top_nav_layout_nav-----------------------------------------)
Sign up
[Sign in](https://medium.com/m/signin?operation=login&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&source=post_page---top_nav_layout_nav-----------------------global_nav------------------)

# Week 2(Day 9): LeetCode Two Pointers(slow & fast): Remove Duplicates from Sorted Array (Brute Force → Optimized)
[](https://medium.com/@sathiyarajanm?source=post_page---byline--d915d9dd4305---------------------------------------)
[Sathiyarajan Mariyappan](https://medium.com/@sathiyarajanm?source=post_page---byline--d915d9dd4305---------------------------------------)
Follow
8 min read
·
1 hour ago
[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fvote%2Fp%2Fd915d9dd4305&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&user=Sathiyarajan+Mariyappan&userId=850a26632d9b&source=---header_actions--d915d9dd4305---------------------clap_footer------------------)
[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Frepost%2Fp%2Fd915d9dd4305&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&user=Sathiyarajan+Mariyappan&userId=850a26632d9b&source=---header_actions--d915d9dd4305---------------------repost_header------------------)
[](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2F_%2Fbookmark%2Fp%2Fd915d9dd4305&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&source=---header_actions--d915d9dd4305---------------------bookmark_footer------------------)
[Listen](https://medium.com/m/signin?actionUrl=https%3A%2F%2Fmedium.com%2Fplans%3Fdimension%3Dpost_audio_button%26postId%3Dd915d9dd4305&operation=register&redirect=https%3A%2F%2Fmedium.com%2F%40sathiyarajanm%2Fweek-2-day-9-leetcode-two-pointers-slow-fast-remove-duplicates-from-sorted-array-brute-force-d915d9dd4305&source=---header_actions--d915d9dd4305-----------------
DeepCamp AI