Ruby on Rails Monday, February 2, 2015

On Mon, Feb 2, 2015 at 7:08 AM, lekha p. <lists@ruby-forum.com> wrote:

> How to get similar elements from a array in Ruby.
>
> eg : [[1,2],[11,2],[23,89]]
>
> when i give input 1 i should get all arrays like [[1,2],[11,2]]

Is [11,2] returned because it has a one in the lowest position, in the
highest position, in any position? Or because 1 + 1 is 2?

IOW, define *exactly* what you mean by "similar". Write a test that
expresses that.

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yA3PCs8%2BDQvv7NXk31r-gXRnDn5PmqV9Ksga9VCffLJQw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment