Fisher–Yates shuffle

Shuffle the numbers like a deck of cards before a game. A fair shuffle gives every possible order the same chance.

Choose a number at random from the free places and swap it with the last free number. If that very number wins, it stays put.

That place is settled. Move the boundary left and repeat until a single number remains.

A non-empty row of n numbers takes n − 1 draws. The time complexity is O(n).