Minimum Height Difference Between Distant Peaks

Problem overview from a real Roblox interview:

Given an integer array and gap value, return the lowest |heights[i] - heights[j]| for index pairs where |i - j| >= gap, or -1 in this Roblox OA.

Check more interview questions and experiences about Roblox

Please log in to view interview details