I am currently new and learning about loop invariants. I have come across this pseudocode where the goal is to shift the elements inside an array with N size in a clockwise direction by K steps.
Pseudocode:
Is at every iteration, new_index is in [0,N)
a good loop invariant? I am really confused about how to pick a good one. Any help would be appreciated.