'Coding has over 700 languages', '67% of programming jobs aren’t in the
technology industry', 'Coding is behind almost everything that is powered
by electricity'

Topics

Given an array * 'arr'* with

```
'arr '= [1,2,3,4,5]
'k' = 1 rotated array = [2,3,4,5,1]
'k' = 2 rotated array = [3,4,5,1,2]
'k' = 3 rotated array = [4,5,1,2,3] and so on.
```

Detailed explanation

```
8
7 5 2 11 2 43 1 1
2
```

```
2 11 2 43 1 1 7 5
```

```
Rotate 1 steps to the left: 5 2 11 2 43 1 1 7
Rotate 2 steps to the left: 2 11 2 43 1 1 7 5
```

```
4
5 6 7 8
3
```

```
8 5 6 7
```

```
Rotate 1 steps to the left: 6 7 8 5
Rotate 2 steps to the left: 7 8 5 6
Rotate 2 steps to the left: 8 5 6 7
```

```
O(n), where ‘n’ is the size of the array ‘arr’ and ‘k’ is the number of rotations.
```

```
1 <= 'n' <= 10^3
1 <= 'arr'[i] <= 10^9
1 <= 'k' < 'n'
```