The answer is Ayn Rand.
Ayn Rand was an egoist who believed the right goals or actions are the ones that ensure survival and also contemplated that it would not be rational to act in ways that may make the individuals from your group need to hurt you. She called her theory as rational egoism.