← Back to companies
[ OK ] Loaded —
[ INFO ]
$ cd
$ ls -lt
01
02
03
04
05
$ ls -lt
01
02
03
04
05
user@intervues:~/$
You are given a list of content IDs that represent views of different pieces of content. Your task is to implement a function that returns the top k most popular content IDs based on their view counts. If multiple content IDs have the same view count, they should be ordered lexicographically (alphabetically) to ensure consistent and reproducible results. The function should efficiently handle large input sizes and edge cases such as an empty list, k being larger than the number of unique content IDs, or k being zero.