Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
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 perusing the Monastery: (8)
As of 2014-12-29 10:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (186 votes), past polls