Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.ruby Subject: Re: Making a count of unique elements in an array Date: Sat, 14 Dec 2013 17:22:03 +0100 Lines: 10 Message-ID: References: <1136789236.482098.144200@o13g2000cwo.googlegroups.com> <5327790f-e3da-4cb6-a94c-b198de7139da@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net 02pB8glINHJCOcPyjwtjngBpkEdg4iJENqTdQM7BdIazkxC5A= Cancel-Lock: sha1:0Uby9Kf6Noxt3r7CIV/XYrLm02M= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 In-Reply-To: <5327790f-e3da-4cb6-a94c-b198de7139da@googlegroups.com> Xref: csiph.com comp.lang.ruby:6898 On 12.12.2013 18:56, vsingla160@gmail.com wrote: > if i have to count no. of distinct elements in a 2D array ,then what to do?? Iterate and count. For counting you can use a Hash with default value 0. Cheers robert