@@ -0,0 +1,609 @@
+#!/usr/bin/env python%0A# encoding: utf-8%0A%0A%22%22%22%0Arotate-array.py%0A %0ACreated by Shuailong on 2016-03-12.%0A%0Ahttps://leetcode.com/problems/rotate-array/.%0A%0A%22%22%22%0A%0Aclass Solution(object):%0A    def rotate(self, nums, k):%0A        %22%22%22%0A        :type nums: List%5Bint%5D%0A        :type k: int%0A        :rtype: void Do not return anything, modify nums in-place instead.%0A        %22%22%22%0A        n = len(nums)%0A        k %25= n%0A        nums%5B:%5D = nums%5Bn-k:n%5D + nums%5B:n-k%5D%0A        %0A%0Adef main():%0A    solution = Solution()%0A    nums = %5B1,2,3,4,5,6,7%5D%0A    k = 3%0A    solution.rotate(nums, k)%0A    print nums%0A    %0Aif __name__ == '__main__':%0A    main()%0A%0A

solve 1 problem