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 7b1cba6

Browse files
solve: 수열과 구간 쿼리 3
1 parent d1edacf commit 7b1cba6

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

‎Level0/PRO181924.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Solution 1
2+
function solution(arr, queries) {
3+
const copiedArr = arr.slice();
4+
5+
queries.forEach(([firstIndex, secondIndex]) => {
6+
[copiedArr[firstIndex], copiedArr[secondIndex]] = [
7+
copiedArr[secondIndex],
8+
copiedArr[firstIndex],
9+
];
10+
});
11+
12+
return copiedArr;
13+
}

‎README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,3 +324,4 @@
324324
| 24.01.06. | `Level 0` | [특정 문자열로 끝나는 가장 긴 부분 문자열 찾기](https://school.programmers.co.kr/learn/courses/30/lessons/181872) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181872.js) |
325325
| 24.01.07. | `Level 0` | [세 개의 구분자](https://school.programmers.co.kr/learn/courses/30/lessons/181862) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181862.js) |
326326
| 24.01.08. | `Level 0` | [배열 조각하기](https://school.programmers.co.kr/learn/courses/30/lessons/181893) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181893.js) |
327+
| 24.01.27. | `Level 0` | [수열과 구간 쿼리 3](https://school.programmers.co.kr/learn/courses/30/lessons/181924) | [JS](https://github.com/JeongHwan-dev/Algorithm-solving-with-js/blob/master/Level0/PRO181924.js) |

0 commit comments

Comments
(0)

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