in reply to Re^3: Divide an array into 2 subsets to verify their sum is equal or not.
in thread Divide an array into 2 subsets to verify their sum is equal or not.

Sorry, but your algorithm must still be wrong if this test passes
my @test_unequal_subsets = ( ... [8, 4, 4, 7, 6, 3], ... );

8+4+4=16

Cheers Rolf

( addicted to the Perl Programming Language)

  • Comment on Re^4: Divide an array into 2 subsets to verify their sum is equal or not.
  • Download Code

Replies are listed 'Best First'.
Re^5: Divide an array into 2 subsets to verify their sum is equal or not.
by kcott (Archbishop) on May 02, 2013 at 22:47 UTC

    Bugger! Yes, you're right. Thanks for pointing that out (++ when the Vote Fairy next visits). That should, of course, be in @test_equal_subsets (8+4+4 = 7+6+3 = 16). Back to the drawing board ...

    Update: Bug fixed. Node updated.

    -- Ken