"""Count observations below a previous peak.

The unit is observations, not calendar days. An unrecovered run is counted through the sample end.
All inputs are synthetic teaching examples. Run: python 05_underwater-duration.py
"""
from tv_math import *

n=max_underwater([100,90,95,101,100,99,98])
assert n==3
print(n)
