Algorithm · Salesforce · Medium
Mountain Array Builder Medium · Greedy, Array · N/A · N/A You are given three integers n, low, and high. Your task is to create an array arr of length n where every element lies between low and high (inclusive) and arr forms a mountain array. A mountain array is one that strictly increases until some peak index i (0 arr[i+1] > \dots > arr[n-1]$$ Among all such arrays that satisfy the bounds, return the one that is lexicographically largest. When comparing two arrays, look at…
Checking your access…