The following code snippet is serving the purpose, but not fully I guess - it is supposed to shift each element of the array to the right by K number of times
How to deal with the scenario if K >= A.size() ? In other words the number of shifting to the right is greater than or equal to the size of the array . It does not work with this input and returns the very same array .
That is, if the size is 5 and K is 5, shift 0 steps.
If the size is 5 and K is 6, shift 1 step.
If the size is 5 and K is 7, shift 2 steps.
If the size is 5 and K is 8, shift 3 steps.
...
If the size is 5 and K is 28, shift 3 steps.