ProProfs Interview Question

Sort the array in ascending and descending order