Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re: Challenge: Number of unique ways to reach target sum

by blokhead (Monsignor)
on Feb 14, 2006 at 15:21 UTC ( [id://530137]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use List::Util 'min';
    use POSIX 'ceil';
    ...
    use Memoize;
    memoize 'num_ways';
    print num_ways(100, 10, 667), $/;
    
  2. or download this
    sub num_ways {
        my ($N, $S, $T, $callback, @so_far) = @_;
    ...
    }
    
    num_ways( 100, 10, 667, sub { print "@_\n" } );
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-03-29 14:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found