Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: "Junkyard" Puzzle: Average of Numbers

by repson (Chaplain)
on May 13, 2001 at 05:42 UTC ( #79982=note: print w/ replies, xml ) Need Help??


in reply to "Junkyard" Puzzle: Average of Numbers

Here's the first thing that springs to mind if I read the problem correctly (30 characters):

sub avg { (map{(1)x$_}@{$_[0]})/@{$_[0]} }


Comment on Re: "Junkyard" Puzzle: Average of Numbers
Download Code
Replies are listed 'Best First'.
Re: Re: "Junkyard" Puzzle: Average of Numbers
by no_slogan (Deacon) on May 13, 2001 at 05:53 UTC
    Clever, but the problem statement doesn't guarantee that we're dealing with non-negative integers.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://79982]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2015-08-30 02:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (346 votes), past polls