This problem has a linear-time solution. By resorting to sorting you make it n log n.
Loading collection data...
This problem has a linear-time solution. By resorting to sorting you make it n log n.