Solved N Log N Complexity Needed Java Answer Pls Actual Code

Solved N Log N Complexity Needed Java Answer Pls Actual Code