DEV Community

Discussion on: Find duplicates algorithm series- A SORTED array as an input.

Collapse
 
karthik19894 profile image
Karthik Ruthiravelu

I just made an inplace algorithm to move the duplicates replaced with zeros to the end of array, this runs in O(n) time and O(1) space, you can find the code for the same here : codepen.io/karthik19894/pen/XWWwbw...