Your question is Random Password Generator. 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.
WorldQuant needs short one-time credentials for an internal research workflow. Implement generate_passwords to return a requested number of unique passwords while preserving uniform randomness across every valid password sequence.
The function receives count and an optional integer seed. Return a list of exactly count strings. Every string must have length 4, use only characters from A-F, a-f, and 1-6, and contain at least one uppercase letter, one lowercase letter, and one digit. No two returned strings may be equal.
When seed is None, use a system-backed random generator. When a seed is supplied, use it only to make tests reproducible. Every valid password must have equal probability of appearing at each position in the generated sequence, subject to sampling without replacement.
Example 1: count = 2 may return ['aB3F', '6cDA']. Both strings satisfy all character and uniqueness rules.
Example 2: count = 1 may return ['A1bc']. It contains one uppercase letter, one lowercase letter, and one digit.
def generate_passwords(count, seed=None):