Improved performance for Lowest Unique Number