HackerRank C++ solution for the Algorithms Implementation coding challenge called Migratory Birds. In this HackerRank problem solving challenge, we are using a C++ map and iterators to find the most common or most frequent integer in an array. For this linear algorithm, the map pairs a set of IDs noted as integers (as the map's keys) with the number of times they appear in the array (as the map's values). We then use the iterators to iterate through our map and compare the map's values to return the key corresponding to the most frequent element in the array.
All HackerRank solutions on GitHub (please leave a star): https://github.com/IsaacAsante/HackerRank
HackerRank's Migratory Birds coding challenge: https://www.hackerrank.com/challenges/migratory-birds/problem