BMC interview question

Sort a given array using stream apo