I find that I save some time teaching arrays and text file together from the start.
Using a counter array to count the number of characters in your array arrName.
Read only some data from the text file into the array (Final 2018 Q4)
Using pos to find see if the item in the array is male or female: Part of the solution for Final 2015 Question 1.4
Finding the highest using the index number.
Removing duplicates: Exemplar 2018 Q 4.1