If we have reached last element . Sum of one subset is sumCalculated , sum of other subset is sumTotal - sumCalculated . Return absolute difference of two sums .
if ( i == 0 ) return abs ( ( sumTotal - sumCalculated ) - sumCalculated ) ;