-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
enhancementNew feature or requestNew feature or request
Description
In ContainsDuplicate.java, the current solution has a time complexity of O(n^2), where n is the number of elements in the array. This can become very slow for larger arrays.
We can still do it solely using arrays, by first sorting the array. Then, iterating through the sorted array and checks if adjacent elements are equal. This can lead to a time complexity of O(n log n).
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request