From 856fc3f1b374650a3f98f2d17cff2eb90b43f0ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EA=B0=95=EC=8B=A0=EC=A7=80?= <101992179+ksinji@users.noreply.github.com> Date: Sun, 8 Feb 2026 23:18:27 +0900 Subject: [PATCH] =?UTF-8?q?[20260208]=20PGM=20/=20LV3=20/=20=ED=92=8D?= =?UTF-8?q?=EC=84=A0=20=ED=84=B0=ED=8A=B8=EB=A6=AC=EA=B8=B0=20/=20?= =?UTF-8?q?=EA=B0=95=EC=8B=A0=EC=A7=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...60\355\212\270\353\246\254\352\270\260.md" | 33 +++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 "ksinji/202602/08 PGM \355\222\215\354\204\240 \355\204\260\355\212\270\353\246\254\352\270\260.md" diff --git "a/ksinji/202602/08 PGM \355\222\215\354\204\240 \355\204\260\355\212\270\353\246\254\352\270\260.md" "b/ksinji/202602/08 PGM \355\222\215\354\204\240 \355\204\260\355\212\270\353\246\254\352\270\260.md" new file mode 100644 index 00000000..4272dd7c --- /dev/null +++ "b/ksinji/202602/08 PGM \355\222\215\354\204\240 \355\204\260\355\212\270\353\246\254\352\270\260.md" @@ -0,0 +1,33 @@ +```java +class Solution { + public int solution(int[] a) { + int answer = 0; + + boolean[] survive = new boolean[a.length]; + + int left = Integer.MAX_VALUE; + + for (int i=0; i a[i]){ + left = a[i]; + survive[i] = true; + } + } + + int right = Integer.MAX_VALUE; + + for (int i=a.length-1; i>=0; i--){ + if (right > a[i]){ + right = a[i]; + survive[i] = true; + } + } + + for (int i=0; i