Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Mark Jason Dominus And Me - The Partition Problem

by Tommy (Chaplain)
on Nov 12, 2012 at 23:29 UTC ( #1003519=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl
    
    ...
    
    exit;
    
  2. or download this
    ->       Calls: 1     Depth: 1     Share: [  ]       Target: 5     Tre
    +asures: [ 50 2 4 3 1 2 4 8 ] ... Putting "50" into the share, leaving
    + treasures [ 2 4 3 1 2 4 8 ]
    
    ...
    A recursive call at depth 3 found that a solution of [ 2 3 ] adds up t
    +o my target of 5 at depth 2
    
    Solution: 2 3
    
  3. or download this
    #!/usr/bin/perl
    
    ...
       return $total;
    }
    
  4. or download this
    Looking for numbers that add up to target: 5...
    Adding up [ 2 + 4 ] = 6
    Adding up [ 2 + 3 ] = 5
    Solution: 2 3
    Calls: 4
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://1003519]
Approved by Athanasius
Front-paged by Athanasius
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (6)
As of 2014-09-17 04:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (57 votes), past polls