@ankitjainb27 I tried this approach for similar problems and I think it is actually amortized O(n). To simplify, let's just work on a normal array, not circular.

For your example, the number of looks up when we run algorithm from right to left is {1, 1, 1, 1, 1, 1} since dp array allows us to only look to the right once.

A worse example is actually something like this {6, 1, 2, 3, 4, 5}. Since, for 6, we have to traverse right 5 times, but other elements only look up once they balance out.

Even if you add increasing or decreasing element to the left of 6, these new elements also need just 1 look up.

The worst example is something like sqrt(n) monotonically increasing subsequences of length sqrt(n) like {7, 8, 9, 4, 5, 6, 1, 2, 3}. Even then, each subsequence only have 1 element that need sqrt(n) look up, and sqrt(n) ^ 2 = n so once again the number of looks up balances out to O(n).

This is very informal so I would appreciate if anyone can help me do a formal evaluation/proof of this type of algorithm.