Bitonic sequence: increases then decreases. Find the longest bitonic subsequence. Compute = LIS ending at (left to right). Compute = longest decreasing subsequence starting at (right to left, which is LIS on reversed array).
For each peak position : bitonic length = (subtract to not count peak twice). Example: . At index (value ): , . Bitonic = .