From 2d28f047d94224e6de5dc033aee967c1ab42d233 Mon Sep 17 00:00:00 2001 From: rl544 <111494264+rl544@users.noreply.github.com> Date: Sat, 17 Dec 2022 18:45:12 +0900 Subject: [PATCH] =?UTF-8?q?updated=20at=202022.=2012.=2017.=20=EC=98=A4?= =?UTF-8?q?=ED=9B=84=206:45:11?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- programmers/같은 숫자는 싫어/solution.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/programmers/같은 숫자는 싫어/solution.java b/programmers/같은 숫자는 싫어/solution.java index ca4fcdb..0bf7f19 100644 --- a/programmers/같은 숫자는 싫어/solution.java +++ b/programmers/같은 숫자는 싫어/solution.java @@ -7,9 +7,7 @@ public class Solution { for(int b : arr){ Object peek = ((LinkedList)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(); }