3 ms·You can use `heapq` from the standard library to at least go from `n k log k` to `n log k`.by thomasahle 10y agoYou can use `heapq` from the standard library to at least go from `n k log k` to `n log k`.