Problem 456 · Medium

132 Pattern

Decide whether an array contains three values in order that form a low, high, then middle pattern. The visual scans from the right, keeping a candidate middle value, and marks the moment a valid triple appears.

Open the interactive visualisation