Given a list of records, I'm trying to get a count of how many records each author has written. The obvious way is to use a map, with the keys being the authors' names and the values the count that gets incremented. But is there a more efficient way to do this, without doing a lookup every iteration?
If I know the authors in advance, I can just create variables for each author and increment them without a lookup and then finally create the map once I'm done reading input. However I only know a few of the authors in the data.
Thanks in advance.