I find it hard to find the maximum in a non-strictly-ascending-then-non-strictly-descending array in less than O(n) time, in particular, when all elements are equal. Do you have any solution or hints for solving this problem?
I could find the maximum in a array which is strictly-ascending-then-non-strictly-descending in O(logn) by checking whether the middle point is on the ascending or descending subarray. However, for the non-strictly ascending and descending one (i.e. with duplicates), I could not find any easy way to check this. (I googled for a while but all solutions are only for strictly-ascending/descending arrays).