rotate array using reverse()