Problem
You are given an array of strings words and an integer k.
Return the k most frequent strings, sorted by:
Descending frequency.
For ties, ascending lexicographic order.
Example:
Input:
words = ["code", "practice", "code", "interview", "practice", "code"],k = 2Output:
["code", "practice"]
words.length can be up to 10^5.
Assume 1 ≤ k ≤ unique(words).
Assume Java, Python, C#, Typescript and JavaScript are allowed.
How to participate
Post your solution as a comment (or link a gist) by March 12 @noon Pacific Time.
Include:
Your language
Brief explanation of your approach
Stated complexity
What I’ll do
By March 13, I’ll:
Pick at least 3 submissions for detailed written feedback.
Publish a Review & Lessons post with:
Annotated solutions
A clean reference solution
Notes on how an interviewer would evaluate your approach.
If you’re short on time this week, at least sketch your approach in prose—that’s still valuable practice.


