diff --git "a/lkhyun/202511/22 PGM Lv2 \352\270\260\354\247\200\352\265\255 \354\204\244\354\271\230.md" "b/lkhyun/202511/22 PGM Lv2 \352\270\260\354\247\200\352\265\255 \354\204\244\354\271\230.md" new file mode 100644 index 00000000..bc6c39b0 --- /dev/null +++ "b/lkhyun/202511/22 PGM Lv2 \352\270\260\354\247\200\352\265\255 \354\204\244\354\271\230.md" @@ -0,0 +1,26 @@ +```java +class Solution { + public int solution(int n, int[] stations, int w) { + int answer = 0; + + int idx = 1; + for(int station : stations){ + if(idx < station - w){ + answer += install(idx,station-w-1,w); + } + idx = station+w+1; + if(station+w >= n) break; + } + if(idx <= n){ + answer += install(idx,n,w); + } + + return answer; + } + public int install(int start, int end, int w){ + int range = end - start + 1; + int size = w*2 + 1; + return range%size != 0 ? range/size + 1 : range/size; + } +} +```