From: Pit Capitain Date: 2008-07-17T23:50:34+09:00 Subject: Re: The next number that is not in an array 2008/7/16 Tim Conner : > How is this done in ruby? 2008/7/17 Robert Dober : > So maybe just in case you can afford the extra runtime for the > "normal" case you can assure nice performance in edge cases by the > functional approach. Tim, I think Robert is right. Depending on the use case there might be better ways to store the restricted numbers and to search for the next unused one. For example it depends on how many restricted numbers there are, how often and how you have to change the restricted numbers, how often you need to fetch the next unused number and so on. It's foremost a question of the appropriate algorithm and data structure and only then how to do it in Ruby. Regards, Pit