Roblox SWE New Grad OA

职位: Roblox SWE New Grad

3道题

贴个总结

Roblox OA.pdf (916.0 KB)

也报一个

Question:
Given an array of integers, representing points in a graph, find all points which are the ‘peak’ points in a graph.

Arr: [ 1, 4, 3, -1, 5, 5, 7, 4, 8 ]

Peaks: [4, 7, 8]

If you plot the numbers in the array as a graph, you’ll see it rising and falling based on the value. For a point to qualify as a ‘peak’, the graph should rise to the ‘peak’ and then fall.