checks that the numbers of elements left are not less than the number of elements required to form the solution
if ( ( intval ( $ n / 2 ) - $ no_of_selected_elements ) > ( $ n - $ curr_position ) ) return ;