There is an array of integer values to be sorted.During the sorting process, the places of two numbers can be interchanged. Each interchange has a cost, which is the sum of the two numbers involved.
You must write a program that determines the minimal cost to sort the sequence of numbers.
for i in {1..100}; do echo $((RANDOM%256)); done
for example. \$\endgroup\$