From: Jason Mayer Date: 2007-01-15T21:49:05+09:00 Subject: newbie question about sets ------=_Part_87771_22481311.1168865342752 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline I'm just curious if there's any way to duplicate values in a set. After quiz 108, I modified my submission so that it was a fully functional game. I then passed around my finished program to some of my coworkers who are interested in ruby. After a few days, someone came back to me with a bug, and this appears to be the root cause of that bug. irb(main):001:0> target = "stuff" => "stuff" irb(main):002:0> a = target.split(//).sort => ["f", "f", "s", "t", "u"] irb(main):003:0> require 'Set' => true irb(main):004:0> s1 = Set.new(a) => # As it stands, if the word ffffuuuuussssstttt existed, it would be considered a subset of a. How do you avoid this using sets? ------=_Part_87771_22481311.1168865342752--