Nice explanation 1)If the array is rotated, there is only one point where a[i-1]>a[i]. 2)If the arrays is sorted and not rotated then a[n-1] > a[0]. One we just iterate the array and increase the counter if the first condition satisfies . Now check second condition, if it satisfies increment counter. Finally return counter
Keep it up man. Solved it on my own it was an easy question.
Really appreciate your commitment to post solution daily.
yepp it was easy :)
hence was being lazy to post
Nice explanation
1)If the array is rotated, there is only one point where a[i-1]>a[i].
2)If the arrays is sorted and not rotated then a[n-1] > a[0].
One we just iterate the array and increase the counter if the first condition satisfies .
Now check second condition, if it satisfies increment counter.
Finally return counter
Great :)
Great approach
Amazing And Thanks 😀😀😀
Most welcome 😊
waited, and finally 🎉
Nice :)
It will come everyday
nice sir...thankyou
Welcome 🙏🏼