Answer:
By preparing
Step-by-step explanation:
In the prepositional phrase above ,preparing -in italics- is the gerund. A preposition is always followed by a noun , so if the idea comes from a verb , this verb has to be nominalised. A verb is nominalised through its gerundial form. By preparing can be substituded by this way // by this means , Justin was able to.... Notice that the gerund has been replaced by a noun phrase, and if we ask: "How was Justin able to pass the exam ...? "; the answer will be: "By preparing...." . Preparing explains the means Justin used; he prepared himself ,probably hard. All this verbal structure can be nominalised through a gerund. The gerung is functioning as a complement to the preposition.