Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d22fe10

Browse files
solve: 수열과 구간 쿼리 4
1 parent 80796f0 commit d22fe10

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

‎Level0/PRO181922.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// Solution 1
2+
function solution(arr, queries) {
3+
const copiedArr = [...arr];
4+
5+
queries.forEach(([s, e, k]) => {
6+
for (let i = s; i <= e; i++) {
7+
if (i % k === 0) {
8+
copiedArr[i] += 1;
9+
}
10+
}
11+
});
12+
13+
return copiedArr;
14+
}

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,3 +305,4 @@
305305
| 날짜 | 난이도 | 문제 | JS 풀이 |
306306
| :-------: | :-------: | :---------------------------------------------------------------------------------------------: | :----------------------------------------------------------------------------------------------: |
307307
| 23.12.01. | `Level 0` | [이차원 배열 대각선 순회하기](https://school.programmers.co.kr/learn/courses/30/lessons/181829) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181829.js) |
308+
| 23.12.03. | `Level 0` | [수열과 구간 쿼리 4](https://school.programmers.co.kr/learn/courses/30/lessons/181922) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181922.js) |

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /