![Write a method called removeDuplicates that accepts a PriorityQueue of integers as a parameter and modifies the queues state so that any element that is equal to another element in the queue is removed. For example, if the queue stores 17, 7,8,8, 8, 10, 45, 45], your method should modity the queue to store 17, 8, 10, 45]. You may use one stack or queue as auxiliary storage](https://media.cheggcdn.com/media%2F455%2F455e40ac-30bd-4d24-8718-9c06a33a17d1%2FphpzrgEzd.png)
In Java language
— so far what I wrote —-
public void removeDuplicates (HeapIntPriorityQueue pq) {
Stack<Integer> aux = new Stack<Integer>();
while (!pq.isEmpty()) {
int n = pq.remove();
aux.push(n);
Write a method called removeDuplicates that accepts
PayPal Gateway not configured
PayPal Gateway not configured