Mock Interview Questions:
followup on second question: Can we do that in less than nlogn time complexity