DEV Community

Discussion on: Filtering out a stray number in an array

Collapse
 
dance2die profile image
Sung M. Kim • Edited

That's a great work around.

Would you be able to do it in O(n) time?

numbers.sort usually be O(n log n) (unless using TimSort and data is already sorted).