题目:

题解:
void swap(int* a, int* b) {
    int t = *a;
    *a = *b, *b = t;
}
void reverse(int* nums, int start, int end) {
    while (start < end) {
        swap(&nums[start], &nums[end]);
        start += 1;
        end -= 1;
    }
}
void rotate(int* nums, int numsSize, int k) {
    k %= numsSize;
    reverse(nums, 0, numsSize - 1);
    reverse(nums, 0, k - 1);
    reverse(nums, k, numsSize - 1);
}
                ![ORA-6544[pevm_peruws_callback-1][604] is caused (Doc ID 2638095.1)](https://img-blog.csdnimg.cn/img_convert/331b38488c612601e70fac350c39575c.gif)
















