← 返回 bytedance 的题目列表Find Local Maximums in Temperature Data
类型:online_judge
Imagine you are working on a model to predict anomalies in temperature fluctuations. The data is continuously streamed from sensors, which you need to clean to develop an initial set of test data. Given an array of integers rawData representing temperature values, and an integer localArea, find every local maximum within rawData. rawData[i] is considered to be a local maximum if, starting from rawData[i]: The localArea numbers to the left and The localArea numbers to the right both form strictly decreasing subsequences. If there are fewer than localArea numbers to the left (or right) of rawData[i], take all numbers on that side into account when computing the local maximum.
Example
Input
rawData = [3, 2, 1, 4, 5, 3, 2, 1], localArea = 2