Rotated but Sorted — Solution & Editorial
Count circular descents (positions where ai > ai+1, wrapping around): a rotation of sorted has at most one.
Complexity: O(N)
Count circular descents (positions where ai > ai+1, wrapping around): a rotation of sorted has at most one.
Complexity: O(N)