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

intermediate Published 20 Jun 2026
Action Steps
  1. Read the LeetCode problem statement for Remove Duplicates from Sorted Array
  2. Apply the brute force approach to understand the problem
  3. Implement the two pointers technique using slow and fast pointers to optimize the solution
  4. Test the optimized solution with sample inputs to verify its correctness
  5. 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------------------)

![Image 1: Unknown user](https://miro.medium.com/v2/resize:fill:32:32/1*dmbNkD5D-u45r44go_cf0g.png)

# Week 2(Day 9): LeetCode Two Pointers(slow & fast): Remove Duplicates from Sorted Array (Brute Force → Optimized)

[![Image 2: Sathiyarajan Mariyappan](https://miro.medium.com/v2/resize:fill:32:32/1*PrdJIIQmqipazPCGGAKj5w.jpeg)](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-----------------
Read full article → ← Back to Reads

Related Videos

Stump Grinder Carbide Wheel Grinds Hardwood To Chips
Stump Grinder Carbide Wheel Grinds Hardwood To Chips
Innoforge Studio
The illusion of originality | Lyra Wells | TEDxLuxembourgCity
The illusion of originality | Lyra Wells | TEDxLuxembourgCity
TEDx Talks
Saylor Plans to sell $1.25B of Bitcoin. Good or Bad for BTC?
Saylor Plans to sell $1.25B of Bitcoin. Good or Bad for BTC?
VirtualBacon
Media Narratives: How Media Shapes Youth Mindset? | Panel Discussion | Fareed Ahmad
Media Narratives: How Media Shapes Youth Mindset? | Panel Discussion | Fareed Ahmad
Qasim Ali Shah Foundation
Git Rerere: The Secret Merge Feature
Git Rerere: The Secret Merge Feature
NeuralNine
The New Era of Sports Fandom: Inside NBA Top Shot with Matt Schorr
The New Era of Sports Fandom: Inside NBA Top Shot with Matt Schorr
Joseph Raczynski