Given an array of strings words and an integer k, return the k most frequent words. Sort the answer by frequency from highest to lowest, and sort words with the same frequency in lexicographical order.
Given an array of strings words and an integer k, return the k most frequent words. Sort the answer by frequency from highest to lowest, and sort words with the same frequency in lexicographical order.