Algorithm · ByteDance · Medium
You are preparing streamed temperature readings for anomaly analysis. Given an integer array rawData and an integer localArea, identify all local maxima in rawData. A value rawData[i] qualifies as a local maximum when, beginning at rawData[i], both of these sequences are strictly decreasing: the localArea values immediately to its left; the localArea values immediately to its right. When fewer than localArea values exist on either side of rawData[i], use every available…
Checking your access…