> You need a way to differentiate the two 5s
As there's no unique filtering or other reduction going on here, there's a permutation chain from input to output.
SORT ( 3, 2, 5, 5 ) ->> ( 2, 3, 5, 5 ) and
SORT ( 3, 2, 5, 5 ) ->> ( 2, 3, 5, 5 )
one or both of those might be incorrect ?( I'm teasing, perhaps )