Sorry if this is a pretty basic question, but I never had this problem before. I'll show what I mean in a pretty basic way:
Let's say I have the array [1, 2, 3]. How can I turn it into [3, 1, 2] or [2, 3, 1] (move each element 1 to the right or the left)? Thanks in advance!