Rotate Array
-
[LeetCode] 189. Rotate ArrayLeetCode 2021. 10. 14. 16:46
https://leetcode.com/problems/rotate-array/ Rotate Array - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com Rotate Array int 벡터가 주어졌을때, 끝에서 k번째부터 끝까지를 떼어 앞으로 붙이는 문제이다. 새로운 벡터를 만들어, k번째부터 추가해주고 앞부분을 추가해준뒤 복사해도 된다. 하지만 부가설명을 보면, 추가 메모리 없이 주어진 벡터만 가지고 해보라고 한다. 그 아래의 힌트들을 보고 깨달았다. 예) [1..