From: Olaf Klischat Date: 2005-07-16T21:15:53+09:00 Subject: Re: [QUIZ] Sampling (#39) Ruby Quiz writes: > This week's Ruby quiz is a classic sampling problem that I've seen many > interesting solutions for in the past. > > The challenge is to implement a program called "sample" that takes exactly two > integer inputs. The first of those should be the number of members you would > like included in the sample. The second is the upper boundary (exclusive) of > the range of integers members can be selected from. The lower boundary is zero > (inclusive). > > Your program should output exactly the requested number of members from the > defined range to STDOUT, one number per line. Each member must be unique and > they should appear in sorted order. (and truly random) Well, how about requiring O(1) memory complexity for the solution? Could be too unchallenging otherwise :)