public int[] solutionThree(int[] a, int k) throws IllegalArgumentException {
		
		if (a == null || a.length < k) {throw new IllegalArgumentException();}
		
		/* Define Min-PriorityQueue of Integers (MIN element always at top of Queue) */
		Comparator<Integer> comp = new MinHeapComparator(); 
		PriorityQueue<Integer> q = new PriorityQueue<Integer>(a.length, comp);
		
		/* Populate Priority Queue with first K elements: O(KLogK); */
		for (int i = 0; i < k; i++) {
			q.add(a[i]);
		}
		
		/* For each of the remaining elements of the array: If a[i] > min; 
		 * then extract MIN from queue and insert a[i]
		 */
		for (int i = k; i < a.length; i++) {
			int min = q.peek();
			if (a[i] > min) {
				q.remove();
				q.add(a[i]);
			}
		}
		
		/* Extract K elements from the Queue: O(KLogK) */
		int[] res = new int[k];
		for (int i = 0; i < k; i++) {
			res[i] = q.remove();
		}
		
		return res;
	}