[golang] leetcode primary - rotating array & duplicate elements exist

Question 1 rotate arrayTopic informationGive you an array, rotate the elements in the array to the right K , positions, where k , is a non negative number. Example 1:Input: nums = [1,2,3,4,5,6,7], k = 3Output: [5,6,7,1,2,3,4]Explanation:Turn right for one step: [7,1,2,3,4,5,6]Turn right for 2 steps: [6,7,1,2,3,4,5]Rotate right for 3 steps: [5 ...

Posted by noiseusse on Mon, 17 Jan 2022 17:55:09 +0100