leetcode
共 1 篇文章
平移数组 Rotate Array
前两天在leetcode上刷题,无意中做了这么个小问题觉得值得反思一下。 题目很简单:Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is rotated to [5,6,7,1,2,3,4] . Note : Try to come up as many solutions as you can, there are at least 3 different ways to solve this proble…
2015-07-22 14:20 · leetcode