removeRandom method

T removeRandom([
  1. int? seed
])

Removes and returns a random element in this set.

Implementation

T removeRandom([int? seed]) {
  assert(isNotEmpty, 'The set must not be empty.');
  final element = random(seed);
  remove(element);
  return element;
}