From: Tom Stut Date: 2013-02-05T10:03:37+09:00 Subject: How to increase flexibility of #flatten I am trying to use flatten to change #this => [ [1, 3], [1, 4], [2, 3], [2, 4], [ [5, 5], [6, 6] ] ] #to this. => [ [1,3], [1,4], [2,3], [2,4], [5,5], [6,6] ] I've tried giving flatten an argument of 1, but it removes dimensions that I want to remain. >> x.flatten(1) => [1, 3, 1, 4, 2, 3, 2, 4, [5, 5], [6, 6] ] is there a way to iterate through that first array to produce the output I want using flatten? -- Posted via http://www.ruby-forum.com/.