CS Interview Question: Top K Frequently Mentioned Keywords

I got this question from LeetCode and I found it particularly interesting.

Problem Statement

Given a list of , a list of and an integer . Find the most popular keywords in order of most to least frequently mentioned.

The comparison of strings is case-insensitive.
Multiple occurrences of a keyword in a review should be considered as a single mention.
If keywords are mentioned an equal number of times in reviews, sort alphabetically.