You are viewing a single comment's thread. Return to all comments →
int n = a.size(); std::vector<int> rotated_array(n); for (int i = 0; i < n; ++i) { rotated_array[i] = a[(i + d) % n]; } return rotated_array; C++20
Seems like cookies are disabled on this browser, please enable them to open this website
Arrays: Left Rotation
You are viewing a single comment's thread. Return to all comments →