Rakesh Mehra interview question

Array and sorting