
-Code
class Solution {
public int[] getConcatenation(int[] nums) {
int len = nums.length * 2;
int[] answer = new int[len];
for (int i = 0; i < len; i++) {
answer[i] = nums[i % (len / 2)];
}
return answer;
}
}'Beakjoon&프로그래머스 > Java' 카테고리의 다른 글
| [LeetCode/Java] Max Consecutive Ones (0) | 2025.11.24 |
|---|---|
| [LeetCode/Java] Shuffle the Array (0) | 2025.11.24 |
| [LeetCode/Java] 94. Binary Tree Inorder Traversal (0) | 2025.11.23 |
| [백준/Java] 15216번 Another Brick in the Wall (0) | 2025.11.23 |
| [LeetCode/Java] 83. Remove Duplicates from Sorted List (0) | 2025.11.22 |