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


in reply to (Golf) Nearest Neighbors

# 79 chars sub nn9 { @_=sort@_;$_{$_[$_]-$_[$_-1]}=[@_[$_-1,$_]]for 1..$#_;@{$_{(sort key +s%_)[0]}} }

snowcrash //////