Top K Frequent Elements

Python3
Complete the method topKFrequent.

Your Logic: