Algorithm · Uber · Easy
Best Value Item Easy · Topics · Company Tags · Hints You are given two arrays of the same length: ratings and costs. Each index i represents an item with a quality rating ratings[i] and a price costs[i]. The "value" of an item is defined as its rating divided by its cost: ratings[i] / costs[i]. Your task is to find the index of the item with the highest value. If several items share the same maximum value, return the smallest index among them. Example 1: Explanation: The…
Checking your access…