educative.io

Can't wrap my head around

Hi there,

I can’t wrap my head around this problem. After seeing the solution, I kind understand why it would work but only for specific input (e.g rotated arrays). For an unsorted array like arr = [0, 40, 50, 10, 20], by applying the solution the return value it’s still 3 which is not.

Does someone have any answer related to this?

Thank you

Hi @samy_dakhlaoui

Kindly look again at the problem statement again. This solution is applicable only on sorted arrays and it’s clearly mentioned in the title of this lesson too.

If you have still any queries feel free to ask.

Happy learning :slight_smile: