Creating a shop with random character on purchase(Croassy Road Style)

I’m trying to create a shop which generates random character upon purchase.

I have set up the scene but getting trouble with the scripts.
Here’s the set up:
*A scene with character selection screen.
In this scene, I have several characters placed. Each character has a boolean “purchased” to check if the character has already been purchased (unlocked) or not.
Also I added a new empty gameobject to contain the list of characters object. Let’s say this is “characterList”

*A shop scene
In this scene there’s only a button “buy”, which if clicked then it will randomly pick a character. The character will be retrieved from the “characterList” list. If the picked character is already purchased, the buy process will automatically re-roll.

Any idea on how to create this?
thank you

If it’s not covered in one of these,

7407326--905588--Screen Shot 2021-08-10 at 9.00.40 PM.jpg

Then the ideas are certainly covered in these:

7407326--905591--Screen Shot 2021-08-10 at 9.01.05 PM.jpg