Phlip wrote: > Here's a ragged array: > > [ [ 1 ¨Â> [ 2, 3 ], > [ 4 ¨Â> [ 5, 6 ], > [ 7 ¨Â> [ 8 ¨Â > > How, with the tightest, or most modern, or coolest statements, can we turn > it into this? > > [ [ 1, 1 ], > [ 2, 3 ], > [ 4, 4 ], > [ 5, 6 ], > [ 7, 7 ], > [ 8, 8 ] ] I'm making the following assumptions: a) we have variable "size" which contains the size of a full subarray b) subarrays should be filled by repeating the last element until the subarray is full. array = [ [ 1 ], [ 2, 3 ], [ 4 ], [ 5, 6 ], [ 7 ], [ 8 ] ] size = 2 array.map do |subarray| subarray + [subarray.last] * (size - subarray.size) end # => [ [1, 1], [2, 3], [4, 4], [5, 6], [7, 7], [8, 8] ] HTH, Sebastian