Your question is Randomly Shuffle a Deck. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Uline may use randomized card decks for testing warehouse picking workflows. Given a list representing a deck, return a uniformly random permutation of the cards without modifying the original list.
Implement shuffle_deck(deck, seed). The optional seed makes the result deterministic for testing. When seed is None, use system-provided randomness. Every permutation must have equal probability.
deck, a Python list containing distinct or repeated card values, and seed, an integer or None.deck, possibly in a different order.def shuffle_deck(deck, seed):