import Foundation extension Array { func rotated(toStartAt index: Int) -> [Element] { guard index != 0 else { return self } return Array(self[index..