Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • 1
    \$\begingroup\$ you can save 2 chars with p.map!{|i|(v=n)+n=i} \$\endgroup\$ Commented Aug 10, 2012 at 11:21
  • \$\begingroup\$ Great one, @jsvnm! Man, how long I combined to shorten that part. Thanks. \$\endgroup\$ Commented Aug 10, 2012 at 11:44
  • 1
    \$\begingroup\$ Maybe a little late, but: why use the variable v? \$\endgroup\$ Commented Dec 15, 2017 at 8:08
  • \$\begingroup\$ Good catch, @GB! That left behind from 1st revision, where… where… doh. Where was also kind of useless. I guess it comes from an earlier attempt when used .map. Thank you. \$\endgroup\$ Commented Dec 15, 2017 at 9:07