Validate a strict mountain
Return True if at least three numbers strictly increase to an interior peak and then strictly decrease. Plateaus are invalid.
items = [1, 3, 2]
print(items[0] < items[1] > items[2])Reason about the state
Climb while adjacent values increase, reject endpoint peaks, then descend. The final pointer must reach the last item. Before writing code, identify what each variable means after one iteration. Walk through the example and explain why the next transition preserves that meaning. Then check the smallest permitted input and a case with repeated values. A correct answer follows the contract for every input, including the boundary cases in the checks. Keep any input mutation within the stated rules; return a fresh result when the task asks for one.
Your task
Return True if at least three numbers strictly increase to an interior peak and then strictly decrease. Plateaus are invalid.
The explanation opens here once every check passes.