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 | 31 |
Tags
- dynamic programming
- simulation
- 파이썬
- Binary Search
- 코딩테스트
- database
- Tree
- Counting
- sorting
- hash table
- string
- java
- Class
- Math
- greedy
- geometry
- SQL
- Number Theory
- Stack
- two pointers
- 자바
- array
- Method
- implement
- Data Structure
- 코테
- Matrix
- Binary Tree
- bit manipulation
- 구현
Archives
- Today
- Total
코린이의 소소한 공부노트
[프로그래머스/Lv.0] 배열 뒤집기 본문
1. Input
1) 정수 배열 num_list
2. Output
2) num_list의 원소의 순서를 거꾸로 뒤집은 배열
3. Constraint
1) 1 <= num_list의 길이 <= 1000
2) 0 <= num_list의 원소 <= 1000
4. Example
Input: num_list={1,2,3,4,5} -> Output: {5,4,3,2,1}
5. Code
1) 첫 코드(2022/10/19)
for(int i=0 ; i<num_list.length/2 ; i++){ // 앞뒤에서 각각 1개씩 짝지어 바꾸기
int temp = num_list[i];
num_list[i] = num_list[num_list.length-1-i];
num_list[num_list.length-1-i] = temp;
}
return num_list;
'코딩테스트 풀이 > JAVA' 카테고리의 다른 글
[프로그래머스/Lv.0] 직각삼각형 출력하기 (0) | 2022.10.21 |
---|---|
[프로그래머스/Lv.0] 문자열 뒤집기 (0) | 2022.10.21 |
[프로그래머스/Lv.0] 나이 출력 (0) | 2022.10.20 |
[프로그래머스/Lv.0] 아이스 아메리카노 (0) | 2022.10.20 |
[프로그래머스/Lv.0] 옷가게 할인 받기 (0) | 2022.10.20 |