Arcesium interview question

Java hacker rank link to solve two level sort using comparators