Read the sentence.

Juanita used her affinity for numbers to help her design a computer program that relied on college-level math formulas, even though she was only in middle school.

Based on the context clues in the sentence, what is the best meaning of “affinity”?

a talent for
an enjoyment of
a fondness for
an understanding of