DEV Community

Discussion on: Google Javascript Interview Question - Remove Duplicates from Sorted Array

Collapse
 
leonardosnt profile image
Leonardo Santos

Your solution is not using O(1) space. It's allocating a new array with at most N elements (worst case), so it's not constant.