← 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 an array of integers representing the heights of buildings in a city skyline. Your task is to return the heights of the K tallest buildings in non-increasing order (i.e., the tallest first). The solution should be efficient for large inputs and should not simply rely on a full sort unless necessary.