Report question

Question: O(N*LogN) algorithm for the following problem