This question already has an answer here:
Put this in an answer before, but actually wondering what the texts would say is the correct course.
You wake up and find yourself faced with two options (you are placed in this position by a third actor).
Option A, kill 1 person.
Option B, 100 other people are killed (by that third actor).
(There is no option C, I would put suicide is better than causing harm to others, but assume this is also not possible)
Moral system 1: Killing = Evil (100%).
Knowing that 'Killing = Evil', you choose option B (with your Essential certainty in the wrongness of killing, there is no reasoning that can convince you to pull the trigger yourself. And as you do not personally pull the trigger, you are not the 'efficient cause'. You have done no wrong within your moral framework, the person damned is the person who executed the 100 people.
Moral system 2: No killing > less killing > more killing.
Logically, B is never reasonable, you choose A.
The second moral system reduces suffering. It is non-essential, therefore being more in line with anatta (imo). Whether you choose A or B (regardless of your moral system), the end result is conditioned by you (by choosing B within the first moral system, you have not escaped the fact that you have chosen, you have just escaped being called the efficient cause). The first moral system 'treats this as that', which the Buddha warned against. In addition, moral system 2 is equivalent to moral system 1 apart from very extreme cases like above, where a thing is compared to itself.
Let's say you are on the Buddhist path. Faced with the above situation, following system 1 and choosing B, you end up not personally causing harm, but there is no escape that you are a condition for the effect. Choosing A, you are plainly no longer in communion as you have broken the 3rd expulsion rule..
And in that the Buddha did not 'invent' anatta, but came to it through a deep and unbiased analysis of empirical experience (the 5 aggregates), would you be pushed to adopt the non-essential system (and choose A)?
Does the Buddha feeding the tigress in a past life point to A being a better answer? In that story, he sacrificed himself out of compassion. Killing someone is not compassionate, but avoiding the deaths of 99 extra people at the expense of becoming a killer (with the consequential karma) surely is!
(Also the efficient cause must matter more than progressively less proximate causes, otherwise the butterfly that flapped its wings and inadvertently flooded New Orleans with that hurricane is heavily damned too! :p )
(putting it in maths terms, choosing A you do less damage but are closer to it, therefore whether A is better than B can't be determined simply)