Peaks in Array
Keep a Fenwick tree of peak marks, so a range count is one prefix difference and an update only re-checks three positions.
Keep a Fenwick tree of peak marks, so a range count is one prefix difference and an update only re-checks three positions.