On Sat, Mar 7, 2009 at 9:48 PM, Phlip <phlip2005 / gmail.com> wrote:
> Rubies:
>
> Here's a ragged array:
>
>    > [ 2, 3 ],
> [ 4  > [ 5, 6 ],
> [ 7  > [ 8   >
> How, with the tightest, or most modern, or coolest statements, can we turn
> it into this?
>
>    ݬ
> [ 2, 3 ],
> [ 4, 4 ],
> [ 5, 6 ],
> [ 7, 7 ],
> [ 8, 8 ] ]

a.each {|i| i[1] ||= i[0]}

martin