From 3683bdf7c2f163126d71d9a67f7b4328f7d4c6b1 Mon Sep 17 00:00:00 2001 From: Ilya Smyshlyaev Date: Fri, 16 Sep 2022 01:40:14 +0400 Subject: [PATCH] add some new examples --- .DS_Store | Bin 0 -> 6148 bytes FizzBuzz.go | 35 ----------------------------------- fizzbuzz/.DS_Store | Bin 0 -> 6148 bytes go.mod | 2 +- rotation/rotation.go | 12 ++++++++++++ 5 files changed, 13 insertions(+), 36 deletions(-) create mode 100644 .DS_Store delete mode 100644 FizzBuzz.go create mode 100644 fizzbuzz/.DS_Store create mode 100644 rotation/rotation.go diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..118ac0472abe514d2ade1563a9225627e2403296 GIT binary patch literal 6148 zcmeHKF^|(Q6n?%d)a8We0D{pHY!qlgDmt-*Tp3^_2nIkUxs+=}8dpt9q^l}rRInU^lb`hbIrjJL`g^in0|0a9VGp1U034mLaSn?bqki&= zZJCw}h)j(Uz#IF%(1VI1L7H zW>e-1$JEI{GLQ^>Gr;|!pb=|ebF{4k%1Qv>3~m$HtRGF%w&;oA*qsqWZ+a8 z(An@b^jKY-t$)_Zv$mi;qfr>wXh2}^T>|jJedNkIy}!^#Tn%iF9EE;M2j)e<2uYO; H`~w4@?P*VC literal 0 HcmV?d00001 diff --git a/go.mod b/go.mod index a9a1309..8c2fc27 100644 --- a/go.mod +++ b/go.mod @@ -1,3 +1,3 @@ -module gotest/fizzbuzz +module gotest go 1.19 diff --git a/rotation/rotation.go b/rotation/rotation.go new file mode 100644 index 0000000..ffb285d --- /dev/null +++ b/rotation/rotation.go @@ -0,0 +1,12 @@ +package rotation + +func Rotation(A []int, K int) []int { + + for i := 0; i < K; i++ { + //A[len(A)-1: - последний элемент; A[:len(A)-1] - все элементы до последнего + A = append(A[len(A)-1:], A[:len(A)-1]...) + + } + + return A +}