From: botp Date: 2012-05-16T18:53:17+09:00 Subject: Re: Ruby Arrays (Pushing Array Inside the same array) On Wed, May 16, 2012 at 5:22 PM, Joe Singh wrote: > Output: A = [9,27,54,63,72,117,126] >        B = [1,2,3,4,5,6,1] first try, > [[],[]].tap{|d,c| b.zip(a).group_by{|x,y| x}.map{|x,y| y.first}.each{|x,y| d< [[1, 2, 3, 4, 5, 6], [9, 27, 54, 63, 72, 117]] then handle the exception kind regards -botp