[LeetCode] Rotate Array
프로그래머스만 풀다가 릿코드 찍먹 시작 문제 Given an integer array nums, rotate the array to the right by k steps, where k is non-negative. 정수 배열 번호가 주어지면 k단계로 배열을 오른쪽으로 돌립니다. 여기서 k는 음수가 아닙니다. 예시 Example 1: Input: nums = [1,2,3,4,5,6,7], k = 3 Output: [5,6,7,1,2,3,4] Explanation: rotate 1 steps to the right: [7,1,2,3,4,5,6] rotate 2 steps to the right: [6,7,1,2,3,4,5] rotate 3 steps to the right: [5,6,7,1,2,3,4] E..
2023. 3. 4.