Deloitte Interview Question

Write a program to sort the elements in given order