http://www.perlmonks.org?node_id=69892


in reply to Re (tilly) 1: (Golf) Nearest Neighbors
in thread (Golf) Nearest Neighbors

Wow, that really is quite ingenious. At first I thought this might fail on some inputs, if sort doesn't compare two sequential numbers, but then I realized that sort requires that every two sequential elements are compared (in some order). Amazing...
   MeowChow                                   
               s aamecha.s a..a\u$&owag.print
  • Comment on Re: Re (tilly) 1: (Golf) Nearest Neighbors