Open
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).