Perl: the Markov chain saw | |
PerlMonks |
Re: Closest-value-in-list Golf!by chipmunk (Parson) |
on May 29, 2001 at 20:26 UTC ( [id://83991]=note: print w/replies, xml ) | Need Help?? |
I disagree with tilly that using sort() is the natural solution. I think this is the natural solution:
This is O(n) rather than O(n*log n). Of course, at 47 characters it is, unfortunately, a longer solution. Oh well!
In Section
Meditations
|
|