Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- Counting
- database
- 자바
- string
- two pointers
- Tree
- array
- dynamic programming
- hash table
- implement
- Binary Search
- 코테
- 코딩테스트
- SQL
- Method
- Number Theory
- geometry
- bit manipulation
- 구현
- Binary Tree
- 파이썬
- sorting
- Matrix
- Math
- java
- greedy
- simulation
- Data Structure
- Stack
- Class
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 순서 바꾸기 본문
1. Input, Output, Example
- num_list를 n+1번째부터의 원소들과 n 번째까지의 원소들로 나눠 n+1번째부터의 원소들을 n 번째까지의 원소들 앞에 붙인 리스트를 반환
2. Constraint
1) 2 ≤ num_list의 길이 ≤ 30
2) 1 ≤ num_list의 원소 ≤ 9
3) 1 ≤ n ≤ num_list의 길이
3. Code
1) 첫 코드(2023/05/01)
class Solution {
public int[] solution(int[] num_list, int n) {
int[] answer = new int[num_list.length];
System.arraycopy(num_list,n,answer,0,num_list.length-n);
System.arraycopy(num_list,0,answer,num_list.length-n,n);
return answer;
}
}
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 0 떼기 (0) | 2023.05.01 |
---|---|
[프로그래머스/Lv.0] 가까운 1 찾기 (0) | 2023.05.01 |
[프로그래머스/Lv.0] 주사위 게임 2 (0) | 2023.05.01 |
[프로그래머스/Lv.0] 수 조작하기 2 (0) | 2023.05.01 |
[프로그래머스/Lv.0] 배열 만들기 3 (0) | 2023.05.01 |