I'm trying to work through an algorithm textbook and I've come across this problem that seems very vague to me and I'm very stuck. Can anyone walk me through it to help me understand how problems like these are to be solved? It's supposed to be done in O(n log n) time but I barely understand what that means...

Here it is: