def rotateLeft(d, arr):
for i in range(d):
j=arr.pop(0)
arr.append(j)
return arr
def rotateLeft(d, arr):
return arr[d:] + arr[0:d]
vector<int> rotateLeft(int d, vector<int> arr) {
for(int i=0; i<d; i++){
int n = arr.front();
arr.erase(arr.begin());
arr.push_back(n);
}
return arr;
}
[HackerRank] Birthday Cake Candles (C++, Python) (0) | 2021.01.14 |
---|---|
[프로그래머스] 체육복 (탐욕법(Greedy)) (0) | 2021.01.13 |
[HackerRank] 2D Array - DS (Python) (0) | 2021.01.12 |
[HackerRank] Staircase (Python, C++) (0) | 2021.01.11 |
[프로그래머스] 모의고사 (완전탐색) (Python, C++) (0) | 2021.01.10 |