C++,3 lines, easy to understand
/*****\n    ****author: cxq\n    ****weibo: http://weibo.com/chenxq1992\n    ****/\n    class Solution {\n    public:\n        void rotate(int nums[], int n, in
    /*****\n    ****author: cxq\n    ****weibo: http://weibo.com/chenxq1992\n    ****/\n    class Solution {\n    public:\n        void rotate(int nums[], int n, int k) {\n            k = k % n;\n            reverse(nums, nums + n);\n            reverse(nums, nums + k);\n            reverse(nums + k, nums + n);\n        }\n    };
[]