class Solution {
func rotate(_ nums: inout [Int], _ k: Int) {
if (nums.count == 0 || nums.count == 1 || k % nums.count == 0) {
return
}
let step = k % nums.count
var newArray : Array = [Int]()
if (step > 0) {
for i in 0...nums.count - 1 {
if (i < step) {
newArray.append(nums[nums.count - step + i])
} else {
newArray.append(nums[i - step])
}
}
nums = newArray
}
}
}