checks if the solution formed is better than the best solution so far
if ( abs ( int ( Sum / 2 ) - curr_sum ) < min_diff [ 0 ] ) : NEW_LINE INDENT min_diff [ 0 ] = abs ( int ( Sum / 2 ) - curr_sum ) NEW_LINE for i in range ( n ) : NEW_LINE INDENT soln [ i ] = curr_elements [ i ] NEW_LINE DEDENT DEDENT else : NEW_LINE