Your question is Random Distinct Numbers Function. 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.
Ford Pro telemetry services need batches of distinct numeric identifiers for simulated vehicle events. Implement a function that returns count uniformly random, distinct integers from the inclusive range [start, end] without materializing the entire range.
The function must support an optional seed so tests and replayable simulations produce deterministic results. The output order should be random, and every valid subset of size count must have equal probability. Do not use random.sample or construct a list containing every value in the input range.
Implement generate_distinct_numbers(start, end, count, seed=None).
start, end, and count, plus an optional integer seed.start <= end, and 0 <= count <= end - start + 1 are guaranteed for valid inputs.count distinct integers from [start, end].ValueError when the range is invalid or too small for count.def generate_distinct_numbers(start, end, count, seed=None):