UKG interview question

Sorting of array