Revert "Revert "MostFrequentElement""

This reverts commit 6323a541c21f298e67b8574f23dc0f5bfd414b93.