"Snake" style solution for cyclically rotating array in LeetCode problem

"Snake" style solution for cyclically rotating array in LeetCode problem