From: Wayne Vucenic Date: 2005-08-02T04:30:19+09:00 Subject: Re: QUESTION: Good data structure for list within list with duplicates? Or, as a variation on the above solutions, use an array of the two keys as the hash key: @h = {["x","aa"] => [2,3], ["x", "bb"] => ["boo"], ["y","aa"] => [5], ["y", "cc"] => ["see", "sea"]} def isValue?(main,embedded,value) return false if @h[[main, embedded]].nil? @h[[main, embedded]].include?(value) end p isValue?("y", "cc", "see") # true p isValue?("a", "b", "c") # false Wayne Vucenic No Bugs Software "Ruby and C++ Contract Programming in Silicon Valley"