[문제]
[답안작성]
class Solution {
public int[] solution(int[] A, int K) {
if( A.length == K || A.length == 1 || A.length == 0 ) {
return A;
}
int temp = 0;
for( int i = 0; i < K; i++ ) {
for( int j = 0; j < A.length; j++ ) {
int t = 0;
if( j == A.length - 1 ) {
A[0] = A[j];
A[j] = temp;
}
else {
t = A[j];
A[j] = temp;
temp = t;
}
}
}
return A;
}
}
[Codility] TapeEquilibrium (0) | 2020.06.28 |
---|---|
[Codility]PermMissingElem (0) | 2020.06.28 |
[Codility]FrogJmp (0) | 2020.06.27 |
[Codiliy]OddOccurrencesInArray (0) | 2020.06.27 |
[Codility]BinaryGap (0) | 2020.06.27 |
댓글 영역