The key to nums in test1
as given is [9, 10, 11,12,13,16,19,20]
. If it is supposed to be of size 8 rotated 5 times, shouldn’t it be [12,13,16,19,20,9,10,11]
?
Hey @ldruizsan
I think you didn’t Understand the Question Clearly…
Here in this video Aakash Sir explained it in simple terms…
Also in simple terms…
-
You have to find the number of rotations we have done on a sorted list.
-
So, for you example i.e.
[9, 10, 11,12,13,16,19,20]
the list is already sorted so we’ve not done any rotations, so the Output should be0
. -
Now the list you are getting by rotatiing the above list 5 times is
[12,13,16,19,20,9,10,11]
,and it is actually the input and we’ve done 5 rotations on the sorted list, so the Ouput for this list should be5
. -
I know it’s a little bit confusing but just go through the video (maybe in 2x speed) you’ll understand the question…Good Luck…
Nevermind. I hadn’t loaded the notebook in a while so I even forgot the fact that the tests we were meant to write them out and I thought they were given. I had that test written wrong.