Am I doing something wrong?

https://leetcode.com/problems/rotate-array/

func rotate(nums []int, k int) {
    steps := k % len(nums)
    
    start := nums[len(nums) - steps:len(nums)]
    end := nums[0:len(nums) - steps]
    
    nums = append(start, end...)
}

I tried to solve this problem, but I stucked with outputing result. Console outputs unchanged result, but I am changing nums array in rotate function

Comments (0)