Exercise: Cyclically Shifted Array

Challenge yourself with an exercise in which you'll have to return the index of the smallest number in a cyclically shifted array.

We'll cover the following


You are required to write a function that determines the index of the smallest element of the cyclically shifted array.

An array is “cyclically shifted” if it is possible to shift its entries cyclically so that it becomes sorted.

The following list is an example of a cyclically shifted array:

    A = [4, 5, 6, 7, 1, 2, 3]

Below are all the possible cyclic shifts of an array:

Get hands-on with 1200+ tech skills courses.