79300713

Date: 2024-12-22 09:00:57
Score: 1
Natty:
Report link

Although computationally slow, this might do the trick:

import numpy as np

def draw_random_samples(len_deck, n_simulations, n_cards):
    
    values = np.random.random((n_simulations, len_deck))
    indices = np.argsort(values, axis=-1)
    indices = indices[...,:n_cards]
    
    return indices
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: Mark