Reorder an array by x elements in Python

Question

Given an array of size n, write a function to move x elements from the front to the end of the array.

For example:

#Given the following:
array = [2,4,6,8,10]
x = 3

#To shift 3 elements you would return:
[8,10,2,4,6]

Solution will be written in Python.

Solution

Access restricted

Subscribe to premium account to see the solution.

Get premium now