Another approach that might be efficient, is to use an auxiliary array to store all the unique elements. It iterates through the original array and checks, if each element is already present in the auxiliary array or not. If Not, it adds the element to the auxiliary array.
This approach eliminates the need for nested loops and reduces unnecessary comparisons, resulting in better performance.