Top K most element

Leetcode Problem : https://leetcode.com/problems/top-k-frequent-words/

My soln : https://ide.codingblocks.com/s/306017

I am getting error in declaration of priority_queue with custom comparator.

@vaishnavtannu,
Check this. It compiles.

Can you please explain me the changes you have made ?

@vaishnavtannu,
You have to pass a functor, not a function. Just remember that this is how it’s done.