LTM Limited interview question

Sorting from DS asked with any language