updated at 2022. 12. 17. 오후 6:45:11

This commit is contained in:
rl544
2022-12-17 18:45:12 +09:00
parent cd5f0bd8ac
commit 2d28f047d9
@@ -7,9 +7,7 @@ public class Solution {
for(int b : arr){
Object peek = ((LinkedList<Integer>)q).peekLast();
if(peek != null && b == (int)peek) continue;
else {
q.add(b);
}
else q.add(b);
}//list 상태에서도 가능하지만 array가 수요이니 array로 변환합니다.
return q.stream().mapToInt(Integer::intValue).toArray();
}