Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

7
  • @Sky Sanders: late-night Saturday post... Commented Mar 7, 2010 at 5:57
  • LOL - late night post for sure. :) I have an infinite loop that keeps pulling items from a source until a null item is returned. I need to pick one of those items at random. Commented Mar 7, 2010 at 5:58
  • I think you've use 'count' when you mean 'total' in your second block of code Commented Mar 7, 2010 at 6:12
  • 2
    If stated clearly, that would make a pretty good interview question. I'll have to keep it in mind. Commented Mar 7, 2010 at 6:27
  • This is a classic Amazon.com interview question -- I think everybody who's interviewed there has been asked this at least once! Commented Mar 7, 2010 at 6:35