findunique added

This commit is contained in:
2022-09-16 14:48:36 +04:00
parent 3683bdf7c2
commit f48d7209c7
4 changed files with 26 additions and 3 deletions

View File

@@ -3,7 +3,7 @@ package rotation
func Rotation(A []int, K int) []int {
for i := 0; i < K; i++ {
//A[len(A)-1: - последний элемент; A[:len(A)-1] - все элементы до последнего
//A[len(A)-1:] - последний элемент; A[:len(A)-1] - все элементы до последнего
A = append(A[len(A)-1:], A[:len(A)-1]...)
}