Keep an array of items you already selected. Then select untill you get an item from the original list that wasn't selected yet. Add that to the array of items you already selected. Be careful though: if you have less items in your original list than you want to select you could end up in an endless loop
|