in reply to Re^2: 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.

++ Thanks. I've rewritten the solution to handle those sorts of cases.

-- Ken

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

Replies are listed 'Best First'.
Re^4: Divide an array into 2 subsets to verify their sum is equal or not.
by LanX (Saint) on May 02, 2013 at 22:29 UTC
    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)

      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