Part 1:
Find peak element in an array
array> array[i-1], array> array[i + 1]
Assuming array[-1] <array[0], array[array.length-1]> array[array.length]
The first example is simple, and the numbers are all different
input: [1, 2, 3, 6, 4, 3, 7, 6]
return: [6, 7]
Part 2:
Assume that the numbers can be equal
input: [0, 1, 2, 2, 3, 4]
return:4
Part 3:
Imagine this series is very long, so we divide it into several smaller arrays and hand it over to different machines for processing. How to deal with false postive peak elements on the boundary?
I couldn't come up with an answer to Part 3, and I was rejected.