@de_mexico said in Java solution with O(n + k*log(n)) complexity:

hich is

Isn't adding to the queue O(n log n)? You have to do it once for each array element (n), but adding an array element to a java priority queue is O(log n). So overall it's O(n log(n) k log(n)).