hi
please help me solving this problem. I have a array like this
$no[0]['a'] = +20;
$no[1]['b'] = +10;
$no[2]['c'] = -15;
$no[3]['d'] = -5;
$no[4]['e'] = +10;
$no[5]['f'] = -8;
$no[6]['g'] = -2;
what I want to do is distributing the plus values to minus value so that all become 0 in minimal shifting and track what value shifted to which . for example
+15 value of $no['0']['a'] shifted to $no[2]['c']
now $no[2]['c'] becomes 0 and $no['0']['a'] still have +5 value, now shift +5 value of $no['0']['a'] to $no[3]['d'] so that values of both $no[3]['d'] and $no[0]['a'] becomes 0 ..and so on
please help