[Java]프로그래머스 프린터
```
import java.util.LinkedList;
import java.util.Queue;
class Solution {
public int solution(int[] priorities, int location) {
Queue q =new LinkedList<>();
for(int p:priorities) {
q.offer(p);
}
int count=0;
while(!q.isEmpty()) {
int item = q.poll();
boolean check = true;
for(int s:q) {
if(item<s) {
check=false;
}
}
if(check) {
count++;
if(location==0)
return count;
}else {
q.offer(item);
}
location--;
if(location<0)location+=q.size();
}
return count;
}
}
```