Algorithm to rotate an array in linear time | Dark Hacker News