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 e3455ef

Browse files
solve: 수열과 구간 쿼리1
1 parent 6f3a9c5 commit e3455ef

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

‎Level0/PRO181883.js

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

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,3 +308,4 @@
308308
| 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) |
309309
| 23.12.05. | `Level 0` | [등차수열의 특정한 항만 더하기](https://school.programmers.co.kr/learn/courses/30/lessons/181931) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181931.js) |
310310
| 23.12.09. | `Level 0` | [커피 심부름](https://school.programmers.co.kr/learn/courses/30/lessons/181837) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181837.js) |
311+
| 23.12.23. | `Level 0` | [수열과 구간 쿼리1](https://school.programmers.co.kr/learn/courses/30/lessons/181883) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181883.js) |

0 commit comments

Comments
(0)

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