Given a sorted and rotated list of \(n\) distinct integers, where the elements are shifted circularly over \(k\) positions. E.g.

When the value of \(k\) is known, the largest number of the list can easily be determined in \(\Theta(1)\) time. Suppose that the value \(k\) is not known. Design and implement an algorithm that finds the largest number in the list.

Assignment

Write a Python function find_maximum(numbers: list). The input argument is a sorted and rotated list and the return value is the largest element in the list.

Examples

>>> find_maximum([5, 6, 1, 2, 3, 4])
6
>>> find_maximum([5, 1, 2, 3, 4])
5
>>> find_maximum([1, 2, 3, 4])
4
>>> find_maximum([3, 1, 2])
3
>>> find_maximum([2, 1])
2
>>> findMaximum([1])
1