Problem Statement:
In Amazon's web infrastructure, the system logs n API requests per second, recording each request's response time in the array responseTimes, where each element denotes the time taken to respond to a single request.
To prevent system overload, a throttling mechanism is applied with the following behaviour:
In each step, select the request with the minimum response time. This request is prioritised for further analysis.
Remove the selected request and its immediate neighbours in the array (based on original indices) from the logs permanently.
This process continues until all requests are removed.
The task is to calculate the total cumulative response time of all selected minimum requests.
Problem Statement:
One of the competitions launched on Amazon gaming platform has come up with a unique ranking system for the participants. It is based on their relative expertise levels and achievement points.
There are p participants where the ith participant has an expertise level of expertise[i] and achievement points of points[i]. The ranking points of the ith participant is defined as the maximum possible sum of points of at most count participants with an expertise level strictly less than expertise[i].
Example:
If expertise = [1, 2, 3, 4], points = [40, 30, 20, 10], and count = 2:
The maximum possible sums of points of any two participants with expertise levels less than the participant in consideration are [0, 40, 70, 70].
Given expertise, points, and count, find each participant's ranking points.