Array randomization

In reply to verif_gal:

There are a number of problems with the code you just posted.

If you constrain
q.size()==1
, then only element
q[0]
will exist.

You cannot compare an int (
a.max()
) with a queue, event if the queue has only one element. You need to write it as
a.max()==q[0]
. But I’m not sure why you would want use a queue constrained to one element.

You constraints would not meet the original criteria of having only one array element with the max value.