e-con Systems Interview Question

technical qn sort in asscending order using function